Problem/Motivation

Follow-up to #2914484: Prevent the layout field from being removed if overrides exist

When attempting to disable Layout Builder for a display, a confusing "Your settings have been saved" message is shown on the Confirmation form before the submit button has been pressed.

Steps to reproduce

Install a fresh standard site
Enable the LB module
Add Layout Builder to an entity display
Disable Layout Builder on the display
Verify on the confirmation form that a confusing "Your settings have been saved" message is shown. See #10

Proposed resolution

Remove this message from the confirmation form.

Remaining tasks

Track down the cause of this messsage and remove it from the confirmation form.

User interface changes

The message will no longer show on the confirm form when disabling Layout Builder on a display.

Before

before

After

after

API changes

N/A

Data model changes

N/A

Issue fork drupal-2941189

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Issue tags: +Needs design
dyannenova’s picture

I think the most straightforward way to handle this would be description text below the grayed out checkbox that explains that there are content layouts saved with this setting, and that the content layouts will need to be reset before the setting can be changed, while linking that text to a batch removal confirmation page.

It's not the easiest way for the user to get the setting changed, but I think it's the most clear.

kristen pol’s picture

@DyanneNova Could you mark up some screenshots where the message would show up?

Also, if someone added steps to reproduce the bad UX, that would be helpful. Thanks.

tim.plunkett’s picture

Component: layout.module » layout_builder.module

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tim.plunkett’s picture

The parent issue has the stable blocker tag.

xjm’s picture

Issue summary: View changes
StatusFileSize
new107.67 KB

I can't find where I originally reported the "for example" bug in the summary, but I think it means this?

The issue title doesn't make that clear; there's an actual UX bug with the (incorrect, but alarming) message that needs to be fixed. Should we file that as a child issue, or retitle this?

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tim.plunkett’s picture

Title: Improve the user flow of disabling per-entity layout overrides » Confirmation form for disabling per-entity layout overrides shows a success message and should not
Category: Task » Bug report
Issue tags: -Needs design +Usability, +Needs issue summary update

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.

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.

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.

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

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

danielveza’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Verified from manual testing that this is still an issue. Updating the IS and added steps to replicate.

danielveza’s picture

Status: Active » Needs review

Opened a MR to stop the message from showing on the Disable Layout Builder Form.

There was no specific test coverage for the disable form itself, rather than add a whole new test for this I added coverage to an existing test that was already asserting LB messages.

danielveza’s picture

Status: Needs review » Needs work

@mstrelan raised a clever alternate approach on the MR. Setting back to NW for that

danielveza’s picture

Status: Needs work » Needs review

Updated the approach based on the feedback from @mstrelan

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative
StatusFileSize
new141.54 KB
new96.29 KB

Can confirm I'm seeing the issue described following the steps of the issue summary.

Attaching before/after screenshots to the summary.

MR does fix the issue.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Not sure this will work if the string has been translated or altered via custom strings; is there no way of preventing the message from being added in the first place?

danielveza’s picture

Status: Needs work » Needs review

Based on @longwave's comment in #27 I've built a POC of an alternate approach that prevents the message from being added to the messenger().

This is a more generic approach that other forms could use in the future if this comes up again in other places in core.

smustgrave’s picture

Can confirm still working @longwave what do you think?

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

To keep this one from stalling going to mark but new solution is also still working as mentioned. If I jumped the gun apologize

longwave’s picture

Status: Reviewed & tested by the community » Needs review

Simplified this even further, if we redirect at all then we shouldn't show the message?

Having said that, the message is partially correct; other settings on the form *have* been saved by this point.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

New approach appears to work as well.

danielveza’s picture

I was concerned the new approach could stop the message from showing when we do want it to display, but I've checked all child classes of EntityDisplayFormBase and the only one that sets redirects in the form state is LayoutBuilderEntityViewDisplayForm.

I prefer the approach taken here to my original MR & it's flexible enough to be used in the future if something like this pops up again. So +1 from me

  • catch committed 1faa0113 on 10.3.x
    Issue #2941189 by DanielVeza, longwave, smustgrave, xjm, tim.plunkett:...

  • catch committed 1634d726 on 10.4.x
    Issue #2941189 by DanielVeza, longwave, smustgrave, xjm, tim.plunkett:...

  • catch committed ebbf0f66 on 11.0.x
    Issue #2941189 by DanielVeza, longwave, smustgrave, xjm, tim.plunkett:...

  • catch committed 47258e9e on 11.x
    Issue #2941189 by DanielVeza, longwave, smustgrave, xjm, tim.plunkett:...
catch’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked back through to 10.3.x, thanks!

Status: Fixed » Closed (fixed)

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