Unlock dialog does not go away on Claro / 9.5.4 and 10.0.4

Created on 2 March 2023, about 2 years ago
Updated 19 March 2023, about 2 years ago

Problem/Motivation

The Unlock dialog does not go away after clicking Unlock. There is an error in the Javascript console:

Uncaught TypeError: Cannot read properties of null (reading 'querySelectorAll')
    at HTMLDivElement.click (ui.js?rqwold:41:23)
    at HTMLButtonElement.<anonymous> (dialog.js:529:12)
    at HTMLButtonElement.dispatch (jquery.min.js?v=3.6.3:2:43336)
    at y.handle (jquery.min.js?v=3.6.3:2:41320)

Steps to reproduce

  • Install stock Drupal 9.5.4 or 10.0.4. Claro is the installed admin theme.
  • Configure the Title field of the Article content type to be locked
  • Edit an article
  • Click the Unlock field button

Expected behavior

Field should be unlocked, dialog dismissed.

Actual behavior

Although the field appears to be unlocked (if your screen is big enough to see behind the dialog), the dialog persists. Clicking the Unlock button again on the dialog does not dismiss the dialog, plus there is a Javascript error:

Uncaught TypeError: Cannot read properties of null (reading 'querySelectorAll')
    at HTMLDivElement.click (ui.js?rqwold:41:23)
    at HTMLButtonElement.<anonymous> (dialog.js:529:12)
    at HTMLButtonElement.dispatch (jquery.min.js?v=3.6.3:2:43336)
    at y.handle (jquery.min.js?v=3.6.3:2:41320)

Proposed resolution

The Drupal behavior that adds the Javascript functionality is being run multiple times, adding mutiple click event listeners to the unlock button, producing the unexpected results. We should use core/once to handle this correctly.

Remaining tasks

Patch.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada m4olivei Grimsby, ON

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024