Overview

Previously reported by … multiple people, but most recently by Gábor Hojtsy.

  1. Install Standard install profile
  2. Install experience_builder
  3. Create article node — let's assume it's node 1
  4. Install xb_dev_standard
  5. Go to /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)
    
  6. Try to edit this article in XB, by navigating to /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.

Proposed resolution

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.

User interface changes

No more crashes.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

wim leers created an issue. See original summary.

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Active » Needs review
wim leers’s picture

Priority: Normal » Major
Status: Needs review » Needs work
Issue tags: +stable blocker, +Needs reroll
Parent issue: » #3521002: [META] Maintainable client-side data model + internal HTTP API

wim leers’s picture

wim leers’s picture

Version: 0.x-dev » 1.x-dev

Any takers? 😇

isholgueras’s picture

Assigned: Unassigned » isholgueras

I still have some time 🤜🤛

isholgueras’s picture

Assigned: isholgueras » Unassigned
Status: Needs work » Needs review
StatusFileSize
new91.69 KB
new95.03 KB

Is this still an issue? I've went through:

1. Install Standard install profile
2. Install experience_builder
3. Create article node — let's assume it's node 1
4. Install xb_dev_standard
5. Go to /node/1 and ...
... add a new image (without the media module)

6. Click "Review 1 change" and "Publish"
7. Visit /node/1 and see my image

I can investigate deeper on when this was fixed, but I think this can be closed.

wim leers’s picture

Assigned: Unassigned » mayur-sose

Oh, that would be _delightful_ news! :D

lauriii’s picture

mayur-sose’s picture

Assigned: mayur-sose » Unassigned
Status: Needs review » Closed (cannot reproduce)

I have followed the steps below to try and reproduce the issue, but issue is not getting reproduced :

Steps followed:

  1. Installed the Standard install profile.
  2. Installed Experience Builder.
  3. Created an article node (e.g., node 1).
  4. Installed xb_dev_standard.
  5. Visited /node/1 to check if the article rendered or if a fatal error appeared.
  6. Attempted to edit the article in XB at /xb/node/1/editor to see if it resulted in a broken XB UI.
  7. Added code component, image component and few more to the canvas
  8. Clicked "Review change" and "Publish" all the changes

While testing, I did not encounter any errors or broken UI. So this issue can be closed.

wim leers’s picture

That's wonderful news! 🥳