When attempting to use DS in conjunction with Layout Builder, there are competing form values. Layout builder has a $form['layout'] form in it.
I'm currently trying to use Layout builder for entity displays, but I want to retain DS for some of my paragraphs. Also its great to have the flexibility between the two layout options.
Currently my steps to reproduce the issue:
1. use patch https://www.drupal.org/project/drupal/issues/2936358#comment-12589800 to configure layout builder per entity bundle (this might change later)
2. enable layout builder and ds
3. Attempt to save an entity display configuration.
Upon saving there will be several errors that all stem from using the same name for input.
Suggested: namespace the form values. Its a simple solution that would probably be an ideal thing regardless of the implications of Layout Builder.
Suggested patch will come in following comment.
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 2966959-22.patch | 15.12 KB | swentel |
Comments
Comment #2
pookmish commentedComment #3
pookmish commentedComment #4
pookmish commentedre-rolling patch for disabling layout builder on a bundle.
Comment #6
abu-zakham commentedComment #7
m.abdulqader commented+1
Comment #8
swentel commentedRaising to critical as I also experienced the problem and it makes saving the manage display not workable at all.
Patch fixes the error, but it looks like the tests don't pass, so we we need to make sure everything still works of course.
Comment #9
swentel commentedLet's see what this does.
Comment #11
swentel commentedfix assert in clonetest
Comment #13
swentel commentedI'm a moron.
Also enabled layout builder in all tests so we know for sure nothing gets in the way.
Comment #15
swentel commentedInteresting. Let's see if everything is fine without enabling layout_builder.
I would also argue that we drop the test for Field Layout, that module is pretty much obsolete anyway.
Comment #16
swentel commentedOk, now again with layout_builder enabled.
Looks like field layout won't be gone yet, so keeping that one as well.
Comment #17
swentel commentedNote, field layout problem might be related to #2931226: Enabling core Field layout module fatals during installation
Comment #19
swentel commentedOk the other failure is because of layout_builder_entity_view_alter() remove our extra fields which are added in hook_entity_view().
I'd argue that this is a bug in layout builder as it should check whether the entity that is being rendered is actually using a layout builder configuration. That should speed up everything too imo.
Comment #20
swentel commentedOpened #2993298: layout_builder_entity_view_alter() should check whether layout builder configuration is used
Comment #21
m.abdulqader commentedThanks for the patch, I applied the patch on last dev version and its work for the first save, after that if I save the display I get this error
Error: Cannot use string offset as an array in /modules/contrib/ds/includes/field_ui.inc on line 371 #0 [internal function]: ds_field_ui_layouts_save(Array, Object(Drupal\Core\Form\FormState))
Comment #22
swentel commentedHmm, yeah, we're getting this too now, in combination with layout builder restrictions module.
New patch attached which fixes that.
Comment #24
abu-zakham commentedComment #25
andypostIt sounds like new major version should be released cos form structure changes
does it makes sense to enable the module for all tests?
Comment #26
tim.plunkettClosed #3023924: An error occurs in Views when attempting to add an exposed filter by ID with the 'Allow multiple selections' option enabled as a duplicate issue
NW since it is failing tests, and for #25
Comment #27
swentel commentedCommitted the patch without the layout_builder tests enabled.
That seems a bit to disruptive. Core doesn't follow that practice either, so not bumping for now. Not many modules alter back on the form after DS has done it's stuff, so I think we're fine here.
Raising to normal to keep track of #2993298: layout_builder_entity_view_alter() should check whether layout builder configuration is used - once that is in, we need to add a test with layout builder enabled.
Comment #29
swentel commentedComment #30
swentel commentedActually, created a follow up at #3029785: Add test with layout builder
Comment #31
swentel commentedResetting critical status.