It's possible to get into a situation where you can't save or discard your edits. It seems like you get "stuck".

Unfortunately, I'm not sure on the exact steps to reproduce, but I've found myself in this situation a few times so I thought I'd at least record of gif of what it looks like in the hopes that we can refine the steps to reproduce later.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

balsama created an issue. See original summary.

tim.plunkett’s picture

Title: Can't save or discard changes » Can't save or discard changes on global regions

I hit this just this morning before my demo. Thankfully it still works for the entity layout part...

The modal is new to me, I need to find when that changed. I think it might be related.

tim.plunkett’s picture

Status: Active » Needs review
FileSize
2.96 KB

This was broken for discard and save by https://git.drupalcode.org/project/lb_everywhere/commit/98aa97a
It was fixed for save in https://git.drupalcode.org/project/lb_everywhere/commit/30bab79

This should fix it for discard.

tim.plunkett’s picture

Forgot to change the existing calls to exitLayoutMode

zrpnr’s picture

Status: Needs review » Needs work

I got into this loop by the following steps:

  1. Visit a page with LBE active (at least 1 editable region)
  2. Make an edit to the region
  3. Click discard changes
  4. At the prompt "are you sure" click confirm

This keeps you in the modal as if nothing happened.

The patch in #4 fixes this loop.

However if you click "cancel" in step 4, you end up on the admin/structure/lbeverywhere/[region]/discard-changes
and are not redirected away by clicking either the confirm or cancel buttons. This seems to be the same with or without the patch.

+++ b/js/lb_everywhere.es6.js
@@ -65,7 +76,7 @@ function exitLayoutMode() {
+          Drupal.AjaxCommands.prototype.exitLayoutMode();

@@ -77,11 +88,11 @@ function exitLayoutMode() {
+              Drupal.AjaxCommands.prototype.exitLayoutMode();
...
+            Drupal.AjaxCommands.prototype.exitLayoutMode();

This should be Drupal.AjaxCommands.exitLayoutMode(), you only use prototype when declaring the function.

zrpnr’s picture

I did a little more digging and I was wrong about removing prototype, since you're calling it directly vs instantiating that Drupal.AjaxCommands function the 3 lines in #4 don't need to be changed.

tim.plunkett’s picture

Status: Needs work » Fixed

As this fixes this specific bug, and the cancel thing is pre-existing, I'm moving that to a follow-up: #3103645: Canceling the discard dialog takes you to a nonsensical page

Status: Fixed » Closed (fixed)

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