I have Drupal 8.7.3 installed with a Node type which has multiple Display View modes configured.

E.g. let's say I have enabled Default, Teaser, List layouts for a page node.

ALL of these view modes have layout builder enabled and configured differently.
DEFAULT layout has Allow each content item to have its layout customized. enabled.

I have a View displaying page nodes in LIST view mode, for example. They all display fine with layout builder context configured in LIST view mode.

As soon as I override one of the nodes layout (customize specific node), I have an issue: all of the nodes that don't have customization, still display with LIST view mode configured. BUT the one that was overridden shows up with its overridden specific layout.

I think that specific node override of layout builder shouldn't affect other view modes (at least until this one is resolved, maybe? https://www.drupal.org/project/drupal/issues/2907413)

Comments

veronicaSeveryn created an issue. See original summary.

veronicaseveryn’s picture

Issue summary: View changes
tim.plunkett’s picture

Version: 8.7.x-dev » 8.8.x-dev
Issue tags: +Blocks-Layouts
Related issues: +#3064039: Custom Node layout override overrides other View modes

Ohhhh that's an interesting way to think of it. I wonder if we can get this working this without breaking things for people who absolutely want their overrides to work in all cases (thought that sounds odd, now that I say it)

tim.plunkett’s picture

veronicaseveryn’s picture

Version: 8.8.x-dev » 8.7.x-dev
Status: Active » Needs review
StatusFileSize
new923 bytes

For now the only place where I could think of fixing it to make it work for me was in OverridesSectionStorage->isOverridden().

Again, maybe it will better fixed when we allow overrides for each display separately, but at the moment I need it to work in my use case (otherwise, teasers become "full" nodes :)) ).

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

Version: 8.7.x-dev » 8.8.x-dev
Issue tags: +Needs tests

Thanks for the initial approach! Looks like a good place to solve it.

Commits land in the latest branch first, so even if we want this in 8.7 we'd need to get it into 8.8 first

  1. +++ b/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    @@ -435,7 +435,9 @@ public function isOverridden() {
    +    $view_mode = $this->getContext('view_mode')->getContextData()->getValue();
    

    Can be replaced with $view_mode = $this->getContextValue('view_mode');

  2. +++ b/core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php
    @@ -435,7 +435,9 @@ public function isOverridden() {
    +    return in_array($view_mode, ['default', 'full']) && !empty($this->getSections());
    

    \Drupal\layout_builder\Form\LayoutBuilderEntityViewDisplayForm::isCanonicalMode() tries to be more specific about whether full or default should be relied up. This also might need to care about one vs the other

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

naveenvalecha’s picture

StatusFileSize
new923 bytes

Here's the rerolled patch for 8.8.x

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

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

So using layout builder in 9.5 I seem to be able to apply layout builder to all the view modes

Can you confirm this is still an issue? Know layout builder was still going through changes in Drupal 8 before D9

If not an issue (or the issue will be solved in https://www.drupal.org/project/drupal/issues/2907413) please close

If a separate issue please reopen with an updated issue summary

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Since this moved to PNMI over 3 months ago, which is the threshold going to close as outdated.

If still a valid issue please reopen with an updated issue summary

Thanks