[wp-trac] [WordPress Trac] #31716: Disabling quicktags for wp_editor settings causes errors in editor-expand.js and wp-auth-check.js
WordPress Trac
noreply at wordpress.org
Fri Mar 20 18:23:17 UTC 2015
#31716: Disabling quicktags for wp_editor settings causes errors in editor-
expand.js and wp-auth-check.js
--------------------------+-----------------------------
Reporter: dougwollison | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 4.1.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31716>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list