Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#31716 closed defect (bug) (duplicate)

Disabling quicktags for wp_editor settings causes errors in editor-expand.js and wp-auth-check.js

Reported by: dougwollison's profile dougwollison Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: Editor Keywords:
Focuses: Cc:

Description

I was messing with the wp_editor settings and it appears that disabling quicktags (i.e. 'quicktags' => false) will cause errors in editor-expand and wp-auth-check to be thrown.

Here's what I'm doing:

add_filter('wp_editor_settings', 'myplugin_editor_settings');
function myplugin_editor_settings($settings){
	$settings['quicktags'] = false;
	return $settings;
}

I end up getting the following errors at some point during page load. Below are excerpts form my console.

load-scripts.php?c=1&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,suggest,wp-ajax-respons…:14
Uncaught TypeError: Cannot read property 'top' of undefined

load-scripts.php?c=1&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,suggest,wp-ajax-respons…:256
Uncaught TypeError: Cannot read property 'hasClass' of undefined

The the first one, which is from editor-expand.js, looks like it pertains to line 353 in the dev file. It looks like there's no check performed to see if $visualTop or $textTop exist before attempting to do anything with them.

The second one, which is from wp-auth-check.js, it's really weird; I've traced it to line 94 in the dev file. The wrap variable doesn't end up getting defined, which is weird because it's set to be defined in the document ready event, which doesn't seem to fire strangely enough.

Considering this is caused by disabling an option that should be entirely acceptable to disable the way I have, I think this is a bug; disabling any other option doesn't appear to cause this.

Change History (1)

#1 @iseulde
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #31163.

Cannot reproduce the second problem, but might have been related to the first.

Note: See TracTickets for help on using tickets.