Showing browser in modal causes javascript error

Created on 24 March 2023, over 1 year ago
Updated 20 April 2023, over 1 year ago

Problem/Motivation

When using the 'Show layout builder browser in modal' option, a javascript error occurs when clicking Add Block in Layout editor. This causes the filter functionality to longer work, and also the modal does not close after authoring a new block.

Steps to reproduce

  • Enable 'Show layout builder browser in modal' in Layout Builder Browser Settings.
  • Click Add Block in a Layout.
  • See javascript error in console
  • Add New block - notice block form does not close
Uncaught TypeError: $(...).once is not a function
    at Object.attach (js_kOtAHT2SbIFQlknaUBNpGi5NmZKvkre7P_x48dLuuFg.js:49:56)
    at js_EBqb1ImUNw4rOPDdRa5BKD4_z_UplJMud4MM8s6aIUk.js:206:24
    at Array.forEach (<anonymous>)
    at Drupal.attachBehaviors (js_EBqb1ImUNw4rOPDdRa5BKD4_z_UplJMud4MM8s6aIUk.js:202:34)
    at HTMLDivElement.<anonymous> (js_EBqb1ImUNw4rOPDdRa5BKD4_z_UplJMud4MM8s6aIUk.js:3502:20)
    at Function.each (js_EBqb1ImUNw4rOPDdRa5BKD4_z_UplJMud4MM8s6aIUk.js:2:3003)
    at E.fn.init.each (js_EBqb1ImUNw4rOPDdRa5BKD4_z_UplJMud4MM8s6aIUk.js:2:1481)
    at Drupal.AjaxCommands.insert (js_EBqb1ImUNw4rOPDdRa5BKD4_z_UplJMud4MM8s6aIUk.js:3500:21)
    at Drupal.AjaxCommands.openDialog (js_EBqb1ImUNw4rOPDdRa5BKD4_z_UplJMud4MM8s6aIUk.js:5832:19)
    at js_EBqb1ImUNw4rOPDdRa5BKD4_z_UplJMud4MM8s6aIUk.js:3174:41

Proposed resolution

Update Javascript to prevent error.

🐛 Bug report
Status

Fixed

Version

1.5

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024