Javascript error "Cannot read property 'options' of undefined"

Created on 10 August 2020, about 5 years ago
Updated 19 August 2025, about 2 months ago

Problem/Motivation

I had this javascript error on a page where entity browser is used (as a dialog) :

Uncaught TypeError: Cannot read property 'options' of undefined
    at HTMLDivElement.<anonymous> (entity_browser.modal.js?v=8.9.2:95)
    at Function.each (jquery.min.js?v=3.5.1:2)
    at S.fn.init.each (jquery.min.js?v=3.5.1:2)
    at Object.Drupal.entityBrowserModal.fluidDialog (entity_browser.modal.js?v=8.9.2:91)
    at entity_browser.modal.js?v=8.9.2:62
    at dispatch (jquery.min.js?v=3.5.1:2)
    at v.handle (jquery.min.js?v=3.5.1:2)

Steps to reproduce

I'm not sure how but I'm trying to check

Proposed resolution

Add a check to dialog variable "js/entity_browser.modal.js" on line 95 (function "Drupal.entityBrowserModal.fluidDialog"):
Replace this code :
if (dialog.options.fluid) {

by :
if (typeof dialog !== 'undefined' && dialog.options.fluid) {

🐛 Bug report
Status

Closed: duplicate

Version

2.2

Component

Miscellaneous

Created by

🇫🇷France mourad-zitouni Paris

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