#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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gambry created an issue. See original summary.

gambry’s picture

Status: Active » Needs review
FileSize
690 bytes

This 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.

Status: Needs review » Needs work

The last submitted patch, 2: field_layout_conflict-2897810-2.patch, failed testing. View results

Kris77’s picture

I have installed Display Suite first...

So, when try to install FIELD LAYOUT and click on INSTALL button, give me a white page...

tezalsec’s picture

Using 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)

mausolos’s picture

I 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).

mausolos’s picture

Btw, 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.

dqd’s picture

Priority: Normal » Critical

Usually 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).
dqd’s picture

@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.

gambry’s picture

I 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.

dqd’s picture

Title: field_layout conflict with ds module (again) » Some fields are not shown when DS used with Field Layout core module
Priority: Critical » Normal

Meh ... 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.

dqd’s picture

JFYI: 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.

dqd’s picture

Ok, 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

gambry’s picture

Thanks 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.

gambry’s picture

Testbot returned "Non tests found". This is due the following error:

17:19:39 Fatal error: Trait 'Drupal\field_group\Tests\FieldGroupTestTrait' not found in /var/www/html/modules/contrib/ds/tests/src/Functional/FieldGroupTest.php on line 14

gambry’s picture

Status: Needs work » Needs review

Setting Needs Review only to trigger normal testbot.

gambry’s picture

Something 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.

gambry’s picture

I'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 .

Status: Needs review » Needs work

The last submitted patch, 2: field_layout_conflict-2897810-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

aspilicious’s picture

Status: Needs work » Postponed (maintainer needs more info)
$fields = [
  'fields[node_title][region]' => 'right',
];

$this->dsSelectLayout();
$this->dsConfigureUi($fields);

The test that is failing seems to be incorrect as you're not adding the body field to the layout.

gambry’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
896 bytes

Right, sorry about that!

Let's re-try.

Status: Needs review » Needs work

The last submitted patch, 21: 2897810-21.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

aspilicious’s picture

Status: Needs work » Needs review
FileSize
968 bytes

Code works, test is incorrect. Updated test, see what will happen..

aspilicious’s picture

Status: Needs review » Postponed (maintainer needs more info)

The patch proves it works. Should I add this extra test? Is there anything else that needs to be fixed?

gambry’s picture

Status: Postponed (maintainer needs more info) » Needs review

I 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!

gambry’s picture

Issue tags: +DevDaysLisbon

  • aspilicious committed fe1da24 on 8.x-3.x
    Issue #2897810 by gambry, aspilicious: Some fields are not shown when DS...
aspilicious’s picture

Status: Needs review » Fixed
dqd’s picture

@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.

aspilicious’s picture

This 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.

dqd’s picture

Great! Thanks for reporting back.

Status: Fixed » Closed (fixed)

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