Problem
ComponentTreeItemList::getHydratedValue() places each child component instance in its parent's slot, which assumes the parent offers that slot. Four scenarios break that assumption:
- The parent does not exist at all (dangling
parent_uuid). - The parent failed to hydrate, so it cannot be rendered, and neither can the component instances in its slots.
- The parent is a kind of component that cannot have slots at all, such as a block component.
- The parent has slots, but not the one claimed by the child.
Scenarios 1, 3 and 4 are rejected by ComponentTreeStructureConstraintValidator, so they can only reach rendering if validation was bypassed, such as by a custom update path or direct database manipulation. Scenario 2 can also occur for a valid component tree, because hydration depends on state outside it.
Before
- Scenarios 1 to 3
-
A fatal error while rendering the host entity, whether or not assertions were enabled:
array_key_exists(): Argument #2 ($array) must be of type array, null given - Scenario 4
-
No error in production, where assertions are compiled out: only assertions touched the invalid value. The child was placed in a slot the parent component does not define, and nothing rendered it, because a component's template only prints the slots it declares. With assertions enabled, an assertion failure was raised instead.
After
- All scenarios
-
The unreachable child and all its descendants are discarded, and the rest of the component tree still renders. A parent that failed to hydrate continues to render the usual error container.
- Scenarios 1 to 3
-
A fatal error becomes a rendered page.
- Scenario 4
-
Renders exactly as before: that child produced no output then, and produces none now.
Who is affected
Only sites with invalid component trees, and only as an improvement: a page that returned a fatal error now renders. No content that previously rendered stops rendering. A child that cannot be placed was already invisible, because no slot printed it.
What to do
Run the doctor to find affected data:
vendor/bin/dr canvas:doctor --all-checks --detailsBoth the config and content checks run the same validation, so every affected component tree is reported. Fix the reported property paths through the editor UI, config import, or a targeted update, then re-run.
No API change
ComponentTreeItemList::getHydratedValue() is private. No public API changed. Sites without invalid component trees are unaffected.