Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#43984 closed defect (bug) (fixed)

Customize: JavaScript error when opening Text widget

Reported by: dlh's profile dlh Owned by: azaozz's profile azaozz
Milestone: 4.9.6 Priority: normal
Severity: normal Version: 5.1
Component: TinyMCE Keywords: has-patch commit fixed-major
Focuses: Cc:

Description

All that should be needed to replicate is to try to expand a Text widget in the Customizer.

The error is Uncaught TypeError: Cannot read property 'zIndex' of undefined, and it occurs here: https://github.com/WordPress/wordpress-develop/blob/6d2bcaa9b39264e5bc8145cf8895f303cabf3fcd/src/wp-admin/js/customize-controls.js#L9256. The error prevents the visual editor from loading.

I think the error began with the TinyMCE update in #43862. Unfortunately, I'm not sure where to begin looking within those changes for what the cause might be.

Attachments (1)

43984.diff (765 bytes) - added by subrataemfluence 5 years ago.
src/wp-admin/js/customize-controls.js

Download all attachments as: .zip

Change History (9)

#1 @subrataemfluence
5 years ago

I could reproduce the issue.

Sincewindow.tinymce.ui.FloatPanel is undefined, window.tinymce.ui.FloatPanel.zIndex is throwing the above error, i.e. zIndex of undefined. I am trying to find out.

Source file:

/wp-admin/js/customize-controls.js

Line #: 9259

Code block:

if ( ! window.tinymce.ui.FloatPanel.zIndex || window.tinymce.ui.FloatPanel.zIndex < 500001 ) {
   window.tinymce.ui.FloatPanel.zIndex = 500001;
}
Last edited 5 years ago by subrataemfluence (previous) (diff)

@subrataemfluence
5 years ago

src/wp-admin/js/customize-controls.js

#2 follow-up: @subrataemfluence
5 years ago

  • Keywords has-patch added; needs-patch removed

My proposed patch currently takes care about the error message and prevents it from popping up on the console.

However, I believe why window.tinymce.ui.FloatPanel is showing undefined is more likely to be the area to inspect.

#3 @subrataemfluence
5 years ago

  • Keywords 2nd-opinion added

#4 @mermel
5 years ago

I can confirm I'm seeing the issue, and it's related to the upgrade.

#5 in reply to: ↑ 2 @azaozz
5 years ago

Replying to subrataemfluence:

However, I believe why window.tinymce.ui.FloatPanel is showing undefined is more likely to be the area to inspect.

Right, seems the wp-before-tinymce-init event fires too early. Switching to tinymce-editor-setup (fired when the wordpress plugin starts to load) fixes it.

Going to commit this for easier testing, also pinging @westonruter to have a look if possible.

#6 @azaozz
5 years ago

In 43181:

TinyMCE: fix setting of zIndex on the dialogs.

Props subrataemfluence, azaozz.
See #43984.

#7 @azaozz
5 years ago

  • Component changed from Customize to TinyMCE
  • Keywords commit fixed-major added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to 4.9.6

#8 @azaozz
5 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 43182:

TinyMCE: fix setting of zIndex on the dialogs.

Props subrataemfluence, azaozz.
Merges [43181] to the 4.9 branch.
Fixes #43984.

Note: See TracTickets for help on using tickets.