diff --git a/src/Symfony/Component/Form/FormRenderer.php b/src/Symfony/Component/Form/FormRenderer.php index b286ffdf41..15a8d08430 100644 --- a/src/Symfony/Component/Form/FormRenderer.php +++ b/src/Symfony/Component/Form/FormRenderer.php @@ -253,10 +253,11 @@ class FormRenderer implements FormRendererInterface // Escape if no resource exists for this block if (!$resource) { - throw new LogicException(sprintf( - 'Unable to render the form as none of the following blocks exist: "%s".', - implode('", "', array_reverse($blockNameHierarchy)) - )); + if (count($blockNameHierarchy) !== count(array_unique($blockNameHierarchy))) { + throw new LogicException(sprintf('Unable to render the form because the block names array contains duplicates: "%s".', implode('", "', array_reverse($blockNameHierarchy)))); + } + + throw new LogicException(sprintf('Unable to render the form as none of the following blocks exist: "%s".', implode('", "', array_reverse($blockNameHierarchy)))); } // Merge the passed with the existing attributes