- Issue created by @karishmaamin
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
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
Active
3.0
Code