Since there are some issues and comments in other issues regarding the topic of compatibility issues between DS and Field layout core module with more or less good descriptions about it flying around, with some of them hijacked and half fixed, and others reporting to break the site and causing WSOD without a way out, I thought it would be important to start this meta issue and to try detangle all the issues in the mix to solve the compatibility issues between DS and Field Layout.
TL;DR Main motivation for this issue are several hijacks and reports complaining about if Display Suite and Field Layout core module are activated in a certain order causes unrevertable WSOD and there is no way out no more to disable the Field Layout before Display Suite.
List of possible related issues or issue comments in them to fix:
- #2897810: Some fields are not shown when DS used with Field Layout core module
- #2878716: field_layout conflict with ds module
- #2795833: [plan] Add layouts to entity displays (both form and view)
EDIT: As stated in the comments many sites already seem to work flawless with both modules activated now but we do not know yet, if the order makes the difference. aspilicious moved this issue to core and gave some interesting insides for patching.
In case if this still hits you, it seems you can only solve this by disabling a module which is used to manage field and node view displays and which makes itself very mandatory when started to use. So this issue becomes slidely tricky in case if you have 70% finished your manage display settings with DS in your project and accidently activate the Layout Plugin module, you maybe loose all the work of a week if there is still something going on. In D8 you do not disable modules no more, you uninstall them. The chance that the settings are lost, is high. Additionally, in D8, the "way to view" content becomes more and more relevant regarding content relations and referencing (context). Without corresponding back references (not default in D8 references) many content is "lost in translation". This means, content can loose context when the display of it connected to other content is broken.
After Dries' great and encouraging keynote regarding the future of Layout API and its modules in core, many will possibly fall into this trap and we should warn them. He clearly states, that it is about D 8.5 and higher but many will think of a 50/50 chance to test the experimental modules already on early stage now below. I strongly recommend to put something in the respective project pages and docs until this issues are fixed.
Maybe useful comments from a hijacked issue fitting to the gathering point: #4, #5, #6, #7
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2931226-9.patch | 611 bytes | gambry |
Comments
Comment #2
dqdComment #3
dqdComment #4
dqdComment #5
dqdComment #6
FrenchRoasted commentedI received a version of this bug while in 8.5.1 core. I had Display Suite installed. I installed Field Layout.
Then I could not get to several admin views. I tried to back out by uninstalling Field Layout. Which died with the same error. So then I uninstalled Display Suite. That let me back in to admin/config/people/accounts, but I still can't uninstall Field Layout. Error log shows instances of this error for each action that I was unable to complete:
TypeError: Argument 1 passed to {closure}() must implement interface Drupal\field_layout\Display\EntityDisplayWithLayoutInterface, instance of Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay given in {closure}() (line 34 of /srv/bindings/222579ed6ff54e7da2207cfdbfb903eb/code/core/modules/field_layout/field_layout.install)
Comment #7
aspilicious commentedField layout and DS works perfectly on a lot of sites these days.
Are you sure you're on the correct branch and run update.php?
Comment #8
aspilicious commentedComment #9
gambryIf DS is installed before Field Layout, installing the latter cause the error in #6, both in drush and from the Extend UI.
I believe the test is not failing because by installing them together the
module_installersort the array putting field_layout before ds and so not triggering the bug.I'm trying to validate this theory.
Comment #10
gambryYep, it does fail locally if not installed together with the other modules.
Comment #12
gambryComment #13
aspilicious commentedI think this is a core bug in field_layout.install
The code assumes every EntityViewDisplay extends EntityDisplayWithLayoutInterface. This is not the case when DS is installed first.
And it's caused by:
Comment #14
aspilicious commentedMoving to the Drupal core queue.
Comment #15
dqdI'll update the issue summary since it has too much "drama" for what it turned out to be. :) But... Great finding by the way! @aspilicious++
I added +Needs patch
Comment #24
quietone commentedIs this reproducible on a supported version of Drupal?
I gather that you get an error if ds is installed and then you enable the field layout module. If that is correct then I could not reproduce this on Drupal 10.0.x. Since I am not sure if that is the correct steps to cause the error I am changing the status to PMNMI to see if this is still a problem.
Comment #27
smustgrave commentedSince there hasn't been a follow up to #24 going to close for now.
If still a bug please reopen.
Thanks!
Comment #28
quietone commentedUpdating tags per Issue tags field and Issue tags -- special tags and for issue #3565085: Drupal core issue tag cleanup.
There are only 3 issues in core using 'needs patch', which isn't very useful on closed issues.