If custom layout is turned on for a content type, then turned off, you are still redirected to change the layout

Created on 30 March 2024, 9 months ago
Updated 2 April 2024, 9 months ago

Problem/Motivation

I have a content type that was briefly set to allow a custom layout per item. I turned that off, but now find that when a content item is saved I am still redirected to set the layout for the item, which then denies me permission. This is annoying..

Steps to reproduce

Create a content type

Set the content type to use layout builder for display

Set up a default layout for the content display and set the content type to allow a custom layout for each node.

Put in some content

Turn off the ability to have a custom layout for each node

Enter another content node - when it is saved there is a page redirect that fails saying you do not have permission.

Proposed resolution

I am not at all certain that I am not just doing something wrong. So if there is a way to fix that behavior I would be happy to know it. I'm not certain that thisonly happens if a node is saved with a custom layout first - I don't think that is the case. So I would either like advice as to how to make that behavior stop, or to ask that there should be some way to be able to turn this off without making entry of content painful afterward. Most of my users would just be bewildered by the option of a custom layout. If this is because you cannot effectively turn this option off if there are already nodes that have a custom layout set--- how in heavens name do I find the nodes that were set to have a custom layout so I can revert them?

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

💬 Support request
Status

Closed: won't fix

Version

10.2

Component
Layout builder 

Last updated 2 days ago

Created by

🇺🇸United States steve hanson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @steve hanson
  • Assigned to sheetal-wish
  • 🇮🇳India sheetal-wish Indore

    Hello Steve Hanson,

    I have followed steps you have mentioned to reproduce issue.

    on this step - Turn off the ability to have a custom layout for each node I am not able to do this step it does not allow to turn off this option without reverting node which has saved with custom layout on, I am not sure how you did it.

    so here is the solution of your question - how in heavens name do I find the nodes that were set to have a custom layout so I can revert them?

    You can write a custom script where you can find node is using custom layout or not for example:

    $node = Node::load($nodeId);
                 $entity_display_repository = \Drupal::service('entity_display.repository');
                 $view_display = $entity_display_repository
                       ->getViewDisplay($node->getEntityTypeId(), $node->bundle());
                 $display = $view_display
                       ->getThirdPartySetting('layout_builder', 'allow_custom');

    here $display will have value 1 if node is using custom layout.

  • Issue was unassigned.
  • 🇺🇸United States steve hanson

    Thank you for the script. All I had to do to turn off the custom setting was to turn it off in the display page. I'm a little surprised by all of this since as far as I can remember I never actually MADE any custom layouts, though I may have accidentally made one that was identical to the default.

    So is the implication here that if I revert any custom ones and then turn off the ability to make custom ones that the automatic redirect will stop?

  • 🇺🇸United States steve hanson

    Oh, I think I understand. The odd behavior is because I am using the Varbase distribution and the Varbase layout builder landing page is apparently what is letting me disable the custom layouts. If I turn that module off I can no longer disable the custom layouts, which at least makes sense. I will go bother the Varbase folks. Thanks.

  • Status changed to Closed: won't fix 9 months ago
  • 🇮🇳India Vivek Panicker Kolkata

    @SteveHanson As the issue does not seem related to Drupal Core, I am closing this issue.
    Please feel free to re-open in case you do not agree.
    Thanks.

Production build 0.71.5 2024