When I enable the Lay-out field in the "Manage form display" of my entity & select the "Layout Builder Widget"
There is a critical error when trying to acces the node edit / add form.

Error: Call to undefined method Drupal\node\NodeForm::getSectionStorage() in Drupal\layout_builder\Plugin\Field\FieldWidget\LayoutBuilderWidget->getSectionStorage() (line 61 of /var/www/html/web/core/modules/layout_builder/src/Plugin/Field/FieldWidget/LayoutBuilderWidget.php)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stijn.blomme created an issue. See original summary.

swentel’s picture

Hmm yes, you shouldn't select that one as that will always crash - irony I know :)

I guess I should add a validation handler that warns the user that the only widget that can be used is the one that this module exposes.

(unless there's another error involved here, haven't manually verified)

stijn.blomme’s picture

Oh, that explains :)

When using the "Layout builder asymetric translation" widget I get the checkbox as expected.

Somehow reading "A widget which you can configure on 'Manage form display' is available to allow copying blocks or not when creating a new translation." on the project page made me assume I had to alter the widget value on the manage form display :)

swentel’s picture

Ah yes, you have to configure it. Core layout builder hides that field on manage form display by default completely. This modules exposes the field again, and adds a new widget, but should protect against selecting the default one :)

Good to know the workaround works - otherwise all test would have been lying which would be weird :)
I'll probably add a validation handler when I find some time, doesn't seem to critical to me at the moment (but annoying if you encounter it of course)

swentel’s picture

Status: Active » Needs review
FileSize
1.5 KB

  • swentel committed 065f365 on 8.x-2.x
    Issue #3076759 by swentel: Error when using the Layout builder widget...
swentel’s picture

Status: Needs review » Fixed

added a validation handler so people can't select it anymore :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.