Problem/Motivation

  1. Use standard profile
  2. enable layout builder
  3. enable layout builder for Articles
  4. Under "CUSTOM DISPLAY SETTINGS" enable Search index
  5. Goto Search Index display - admin/structure/types/manage/article/display/search_index
  6. Layout Builder already enabled for View Mode(not sure if this is intended behavior but seems good)
  7. Click Manage Layout
  8. All article fields will show 2x in layout

Proposed resolution

Fix

Remaining tasks

User interface changes

API changes

Data model changes

Comments

tedbow created an issue. See original summary.

tedbow’s picture

StatusFileSize
new2.1 KB

Here is test only patch that fails.

tedbow’s picture

Status: Active » Needs review
tim.plunkett’s picture

I could have sworn we had an issue for this already, but I can't find it.

When a view mode is enabled, it copies all the values from the default view mode.
So if LB is enabled for the default, it will be for the new one. And then it also copies over the sections from the default, before going through and initializing all the fields as new components...

Status: Needs review » Needs work

The last submitted patch, 2: 3002941-test-only.patch, failed testing. View results

tim.plunkett’s picture

#2990517-3: Adding a display mode to a content type using layout, and disabling layout on that new display mode removes the layout_builder__layout field and breaks layout in already configured display modes. was the issue I was remembering. That issue is about what happens when trying to get around this bug, and is way worse (data loss!).
I haven't compared the test from this and that issue, but I bet they are similar.

xjm’s picture

Priority: Normal » Critical

This sounds major or critical; marking critical pending feedback.

chipway’s picture

When I follow the summary test process (before patching), I get a WSOD, while other site pages work.

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in [error]
/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php:420
...
Strange.

tim.plunkett’s picture

tim.plunkett’s picture

tim.plunkett’s picture

Status: Postponed » Needs review
StatusFileSize
new2.85 KB
new761 bytes

Actually not postponed on that, not sure what I was thinking.

Status: Needs review » Needs work

The last submitted patch, 11: 3002941-view_mode-11.patch, failed testing. View results

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new3.31 KB
new826 bytes

Had a test depending on the old behavior :)

tedbow’s picture

Status: Needs review » Reviewed & tested by the community

Fix looks good!

  • larowlan committed 19513d5 on 8.7.x
    Issue #3002941 by tim.plunkett, tedbow: New enabled View modes for...
larowlan’s picture

Version: 8.7.x-dev » 8.6.x-dev
Status: Reviewed & tested by the community » Fixed
+++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php
@@ -373,6 +403,7 @@ public function testLayoutBuilderUiFullViewMode() {
+    $this->drupalPostForm("$field_ui_prefix/display/full", ['layout[enabled]' => TRUE], 'Save');

nice we were relying on the side effect

Committed 19513d5 and pushed to 8.7.x. Thanks!

c/p as 7f448d596d for 8.6.x

  • larowlan committed 7f448d5 on 8.6.x
    Issue #3002941 by tim.plunkett, tedbow: New enabled View modes for...

Status: Fixed » Closed (fixed)

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