Problem/Motivation
When enabling the "Lock form using JS" option in the Content Lock module settings, the Unlock button no longer appears on the edit form, even though the lock is successfully applied.

This seems to be due to the fact that the lock is created client-side via JavaScript, which occurs after the form is rendered. Since the Unlock button is added during server-side form building, it doesn’t detect the lock in time, and therefore the button is not rendered.
Disabling the "Lock form using JS" option resolves the issue — the lock is created on the server as the form loads, and the Unlock button appears as expected.
Environment:
Drupal core: 11.1.7
PHP: 8.3.15
Theme: Gin 4.0.6 (used as default and admin theme)
Content Lock module: 3.0.0-alpha2
Steps to reproduce
Enable Content Lock module (version 3.0.0-alpha2)
Enable the "Lock form using JS" setting at /admin/config/content/content-lock
Edit a content entity (e.g., a node)
Open the same node edit page in another session or browser
Observe that the lock message appears but the Unlock button is missing
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2025-05-14 124941.png | 17.48 KB | karishmaamin |
Comments
Comment #2
karishmaamin commentedComment #3
alexander tallqvist commentedConfirming that we're experiencing exactly the same issue on our site with similar specs, only we're running gin 3.0.0. I had to roll back gin to verison 3.0.0-rc13 for the "Lock" button to show up again.
Comment #4
alexpottWe no longer offer the option to lock using JS - see #3529333: Remove the JS route for locking an entity for details.