Entity browser modals won't close on content types where Mercury is not enabled

Created on 6 December 2024, 12 days ago

Problem/Motivation

For content types that have a reference field using entity browser, but for which Mercury Editor is not enabled, a JavaScript error prevents the entity browser modal from closing. The issue can be traced to entity_browser.modal_selection.js, which throws this error message:

Uncaught TypeError: Cannot read properties of null (reading 'close')

A quick fix is to change the line
element.closest('mercury-dialog').close();
to
element.closest('mercury-dialog')?.close();

However, the larger concern appears to be that Mercury Editor libraries are loaded for any content type, regardless of whether or not Mercury is actually enabled for that content type.

πŸ› Bug report
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States sethhill

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024