Gin theme Unlock button missing when "Lock form using JS" is enabled

Created on 14 May 2025, 2 days ago

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

๐Ÿ“Œ Task
Status

Active

Version

3.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia karishmaamin

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

Comments & Activities

Production build 0.71.5 2024