#2878716: field_layout conflict with ds module has been closed, however patch and test coverage in there are not fully testing the scenario leading to the issue been closed when actually the problem still exists.
As I don't have the permission to re-open it I'm creating this issue to get attention from maintainers. We can either continue the discussion there if someone opens it or using this as followup.
To replicate:
- Enable field_layout and ds
- 'One column' layout is automatically selected for any content type (I saved the Manage Form Display anyway, not sure if required to trigger the bug).
- Select a DS layout on Manage Display
- Make sure at least a DS field (i.e. Title) and a not-DS field (i.e. Body) are visible
- Save the changes
- Open your content and the not-DS fields are not showing. In my example with Title and Body, only Title shows up.
Comment | File | Size | Author |
---|---|---|---|
#23 | 2897810-23.patch | 968 bytes | aspilicious |
#21 | 2897810-21.patch | 896 bytes | gambry |
Comments
Comment #2
gambryThis is the test coverage for the body. It comes red on mine, let's see what testbot says.
Setting NR in order to trigger tests.
Comment #4
Kris77 CreditAttribution: Kris77 commentedI have installed Display Suite first...
So, when try to install FIELD LAYOUT and click on INSTALL button, give me a white page...
Comment #5
tezalsec CreditAttribution: tezalsec commentedUsing Drupal 8.3.4, I tried installing the field_layout module to give it a try, but both installing and uninstalling give me this error:
The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to {closure}() must implement interface Drupal\field_layout\Display\EntityDisplayWithLayoutInterface, instance of Drupal\Core\Entity\Entity\EntityViewDisplay given in {closure}() (line 34 of core/modules/field_layout/field_layout.install).
Now the checkbox says it is installed, but it won't let me uninstall, without the above error.
I have Display Suite installed as well, is it conflicting? The error just seems to point at a missing class implementation?
I want to deinstall field_layout and keep ds, but I can't as it produces the same error.
The field_layout maintainer says to bring it up here (https://www.drupal.org/node/2795833#comment-12186533)
Comment #6
mausolos CreditAttribution: mausolos commentedI can confirm I had the same issue as #5. Once I had enabled field_layout (complete with error), I was unable to uninstall it do to the same error.
However, by uninstalling ds module first, I was able to successfully uninstall field_layout module.
Also, I think this is actually a field_layout issue, since the error includes this at the peak of the backtrace:
#1 /apps/drupal/d8root/core/modules/field_layout/field_layout.install(37): array_map(Object(Closure), Array)
I'll play with it, but I suspect doing some variable testing before attempting to map the array may solve the problem (like, if it's getting passed something that's NULL or whatever).
Comment #7
mausolos CreditAttribution: mausolos commentedBtw, if you simply make sure to enable field_layout before you enable ds, you're okay (so far). I'll see what it's like when I start actually adding content and trying to USE the modules.
Comment #8
dqdUsually I am reverting other users priority settings down to normal, but here I am pretty sure "Critical" is required. Why? Because it seems you can only solve this by disabling a module which is used to manage field and node view display and which makes itself very mandatory when used once.This means, that if you have 70% finished your manage display settings with DS in your project and accidently activate the Layout Plugin module, you probably loose all the work of a week. 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" of 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 Drupal v 8.5 and higher, but many will think of a 50/50 chance to test the experimental modules already on early stage below. I strongly recommend to put something in the respective project pages and docs until this issue is fixed.EDIT: This comment was mistakenly made here before I realized, that this issue here has been hijacked. The comment is regarding another topic mentioned by #4 #5 #6 that: Field Layout module and Display Suite module have some compatibility issues which can cause WSOD under certain circumstances by activation making it impossible to deactivate Field Layout without deactivating Display Suite and loosing settings (I will create another issue for that).
Comment #9
dqd@gambry: did you have tested and can you report if your patch can fix the issue at least temporarly for the moment to be able to disable Layout Plugin module again without disabling DS? Many will be scared to apply the patch without a report about what it does.
Comment #10
gambryI don't remember getting errors while using both. The only issue I had having both makes DS view displays unusable.
The patch I uploaded is a test-only, flagging there is - still - a problem. There isn't a solution yet.
Comment #11
dqdMeh ... after further reading (sorry, I read it at a glimpse first, I was in a rush) I realize now that the other users have hijacked this issue after they have been told to post in another issue queue here. Damn it....
#4 #5 #6: You have hijacked an issue, which is about another topic. Please don't do that. This can cause many confusion. Please find the proper issue for your problem or create a new one (Or wait until I did it). I will try to fix this disaster caused here and over there on #2795833: [plan] Add layouts to entity displays (both form and view) and on #2878716: field_layout conflict with ds module. I will post a link here when the right place is found.
Thanks @gambry for your fast reply and sorry for the confusion. We need to rename this issue here, since this very generic title is oviously causing confusion.
Comment #12
dqdJFYI: it seems that #2878716: field_layout conflict with ds module possibly solved 50% the issue posted by #4 #5 #6. I tested to get out of WSOD by doing
composer require 'drupal/ds:3.x-dev'
to update to latest dev of DS and the WSOD disappeared for that moment. But uninstalling Field_Layout still not possbile (causing WSOD again). Also Drush (not possible). I sadly do not have the time yet to tinker about if it is related or not. But again, this all will have place in another issue later.Comment #13
dqdOk, as already announced, I started another issue for the topic of #4 #5 #6 and by trying to make it a gathering point and parent for this issues. If you came here because of a broken site by Display Suite and Field layout module enabled, please follow this meta issue first: #2931226: Enabling core Field layout module fatals during installation
Comment #14
gambryThanks for the cleanup @diqidoq . Much appreciated.
I've launched a re-test for the test-only patch on #2 to see if problem is still there.
Comment #15
gambryTestbot returned "Non tests found". This is due the following error:
Comment #16
gambrySetting Needs Review only to trigger normal testbot.
Comment #17
gambrySomething is wrong with the field_group dependency. Probably an update on that side triggering a failure on DS side. I'm going to investigate today, in the meanwhile leaving this NR to keep triggering testbost and will open a new issue for the field group trait error on tests.
Comment #18
gambryI've opened an issue to fix the tests problem. I think this - and all 8.x issue - are now blocked by #2931325: 8.x-3.x tests broken due field_group missing dependency .
Comment #20
aspilicious CreditAttribution: aspilicious commentedThe test that is failing seems to be incorrect as you're not adding the body field to the layout.
Comment #21
gambryRight, sorry about that!
Let's re-try.
Comment #23
aspilicious CreditAttribution: aspilicious commentedCode works, test is incorrect. Updated test, see what will happen..
Comment #24
aspilicious CreditAttribution: aspilicious commentedThe patch proves it works. Should I add this extra test? Is there anything else that needs to be fixed?
Comment #25
gambryI can't replicate it anymore, however I still see the error described in #2931226: Enabling core Field layout module fatals during installation when installing ds with or before field_layout. Maybe the issue is related to that.
This one can be close. I do suggest we add the additional test because currently we are only testing ds/field_layout works by asserting only against a DS field. Asserting the body too won't implicate the test permorfance but will validate all works as expected.
Setting this to NR just for @aspilicious to see my comment and decide what to do. After the maintainer decision the issue can be closed.
Thanks!
Comment #26
gambryComment #28
aspilicious CreditAttribution: aspilicious commentedComment #29
dqd@aspilicious: Does it solve https://www.drupal.org/project/drupal/issues/2931226#comment-12677004 ? Just asking if we can mark it then since it has a [plan] issue only left over then in the list. But, not sure if your finding over there is maybe still relevant.
Comment #30
aspilicious CreditAttribution: aspilicious commentedThis commit doesn't solve anything it just show the code actually works if installed in the correct order. The problem you reference isn't a big deal either. It crashes during install but the site will work afterwards. The install hook that crashed shouldn't be fired when DS is installed.
Comment #31
dqdGreat! Thanks for reporting back.