[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
|
||||
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
|
||||
|
Reference in New Issue
Block a user