[Form] Add exception to FormRenderer about non-unique block names
This commit is contained in:
parent
0854c121c9
commit
c6db6f3d50
@ -253,10 +253,11 @@ class FormRenderer implements FormRendererInterface
|
|||||||
|
|
||||||
// Escape if no resource exists for this block
|
// Escape if no resource exists for this block
|
||||||
if (!$resource) {
|
if (!$resource) {
|
||||||
throw new LogicException(sprintf(
|
if (count($blockNameHierarchy) !== count(array_unique($blockNameHierarchy))) {
|
||||||
'Unable to render the form as none of the following blocks exist: "%s".',
|
throw new LogicException(sprintf('Unable to render the form because the block names array contains duplicates: "%s".', implode('", "', array_reverse($blockNameHierarchy))));
|
||||||
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
|
// Merge the passed with the existing attributes
|
||||||
|
Reference in New Issue
Block a user