Content Lock is released too early after saving a node in Mercury Editor

Created on 12 May 2025, 4 days ago

Problem/Motivation

In a typical Drupal editing flow, after a node is saved, the user is redirected (to `/admin/content`) and the content lock is correctly released. However, it appears that the Mercury Editor workflow is intentionally different: the Save button (`.me-save-btn`) is labelled “Save and continue editing”, indicating that the user will remain on the edit screen after saving.

This creates a conflict with the Content Lock module. Once the lock is released after saving, it is not automatically reacquired—even though the user is still actively editing. This opens the risk of simultaneous edits by multiple users and potential content loss, defeating the purpose of the locking mechanism.

Steps to reproduce

  1. Log in as User A and open a node in the Mercury Editor.
  2. Open an incognito window, log in as User B, and attempt to edit the same node — it should be locked.
  3. In User A’s window, click Save on the node.
  4. After the save completes, User A remains on the edit page, but the content lock is released.
  5. User B can now also edit the node despite User A still actively working in the editor.

Proposed resolution

Ensure the lock remains active if the user is still on the Mercury Editor page after saving.

Locks should only be released:

  • When the user exits the editor intentionally (e.g., clicking the “Exit without saving” (“Done” button).
  • If the lock is manually broken by another user with permissions.
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom DrupalGideon London

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

Comments & Activities

Production build 0.71.5 2024