- Issue created by @wim leers
- Merge request !748Resolve #3510892 "Xb existing articles gracious fallback" → (Open) created by wim leers
Previously reported by … multiple people, but most recently by Gábor Hojtsy.
experience_builder
1
xb_dev_standard
/node/1
and you'll get not the rendered article but … a fatal error:The website encountered an unexpected error. Try again later.
AssertionError: assert($items->count() === 1) in assert() (line 30 of modules/contrib/experience_builder/src/Plugin/Field/FieldFormatter/NaiveComponentTreeFormatter.php).
Drupal\experience_builder\Plugin\Field\FieldFormatter\NaiveComponentTreeFormatter->viewElements(Object, 'en') (Line: 91)
Drupal\Core\Field\FormatterBase->view(Object, 'en') (Line: 275)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 340)
Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 24)
Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 282)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 239)
…
Drupal\Core\DrupalKernel->handle(Object) (Line: 21)
/xb/node/1/editor
, which will not lead to a working XB UI, but to:Both of these make trying XB, or gradually adopting it a very unfriendly (and even frightening) experience on existing content.
The crash in point 5 is caused by \Drupal\experience_builder\Plugin\Field\FieldFormatter\NaiveComponentTreeFormatter::viewElements()
requiring a non-empty XB field.
The crash in point 6 is caused by \Drupal\experience_builder\Controller\ApiLayoutController::get()
having a similar assumption.
No more crashes.