- Issue created by @robbevb
- Merge request !47Issue #3418674: Entity browser modals are incompatible with Bootstrap modals → (Open) created by robbevb
This may be a pretty specific issue, but I'm using entity browser modals along with the Bootstrap theme, which let's you use its own modal system rather than core dialogs. In this case, Entity Browser wrongfully assumes that it can access certain dialog option attributes, which are not available on the Bootstrap modals.
- Create an entity browser using the Modal display plugin
- Use Bootstrap as theme and enable Jquery UI Modal bridge
- Entity browser button will be unable to open the modal with the following error in the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'options')
at HTMLDivElement.<anonymous> (entity_browser.modal.js?s86hmi:97:18)
at Function.each (jquery.min.js?v=3.7.1:2:3129)
at ce.fn.init.each (jquery.min.js?v=3.7.1:2:1594)
at Drupal.entityBrowserModal.fluidDialog (entity_browser.modal.js?s86hmi:93:14)
at entity_browser.modal.js?s86hmi:64:35
at dispatch (jquery.min.js?v=3.7.1:2:40035)
at v.handle (jquery.min.js?v=3.7.1:2:38006)
Add a nullcheck when accessing the dialog configuration.
var dialog = $this.find('.ui-dialog-content').data('ui-dialog');
if (dialog.options.fluid) {
Becomes
var dialog = $this.find('.ui-dialog-content').data('ui-dialog');
if (dialog && dialog.options.fluid) {
Active
2.10
Display plugins