Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')

Created on 30 January 2024, 11 months ago
Updated 26 July 2024, 5 months ago

Problem/Motivation

gets builder.js?s82dv8:331 Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf') on node edit form.

Steps to reproduce

When a paragraph is added inside a node using a paragraph reference field, and inside the manage form display the mode is changed to modal form in the widget settings, the above error occurs.

Proposed resolution

There should be a check for this:
Change

  if ($dialog.attr('id').indexOf('lpb-dialog-') === 0) {
      if ($dialog.dialog('option', 'buttons').length > 0) {
        return;
      }

to

  if ($dialog?.attr('id')?.indexOf('lpb-dialog-') === 0) {
      if ($dialog.dialog('option', 'buttons').length > 0) {
        return;
      }
🐛 Bug report
Status

Postponed: needs info

Version

2.0

Component

Code

Created by

🇮🇳India abhinesh

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

Comments & Activities

Production build 0.71.5 2024