/** * @param \Sonata\AdminBundle\Validator\ErrorElement $errorElement * @param \Sonata\PageBundle\Model\BlockInterface $block */ public function validate(ErrorElement $errorElement, $block) { if ($this->inValidate) { return; } // As block can be nested, we only need to validate the main block, no the children $this->inValidate = true; $this->cmsManager->validateBlock($errorElement, $block); $this->inValidate = false; }