Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#16098 closed defect (bug) (fixed)

JavaScript error in TinyMCE

Reported by: pavelevap's profile pavelevap Owned by: koopersmith's profile koopersmith
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: TinyMCE Keywords: has-patch commit
Focuses: Cc:

Description

Using latest trunk, no plugin, IE8.

Message: 'content' is null or not object.
Line: 1
Char: 8525
Code: 0
URI: http://localhost/Wordpress/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js?ver=3393

This error appears using visual editor, only after saving post. When adding new post, there is no error.

Attachments (3)

tinymce.diff (16.4 KB) - added by filosofo 12 years ago.
16098.diff (1.4 KB) - added by koopersmith 12 years ago.
16098.2.diff (1.5 KB) - added by koopersmith 12 years ago.

Download all attachments as: .zip

Change History (16)

#1 @nacin
12 years ago

  • Milestone changed from Awaiting Review to 3.1

#2 @SergeyBiryukov
12 years ago

Can't reproduce with IE 8.0.6001.18702. Perhaps something else is going on there.

#3 @nacin
12 years ago

  • Keywords reporter-feedback added

#4 @pavelevap
12 years ago

I tried to debug this error in IE8 (Developer tools, F12) and script stops with error on following code:

g.content=g.content.replace(/<!--more(.*?)-->/g,e);

My IE8 is 8.0.6001.18999.

I am not sure where else should be problem?

@filosofo
12 years ago

#5 @filosofo
12 years ago

I had to turn off debug mode to reproduce.

I don't have TinyMCE source, and patch diff highlighting isn't very helpful, so here's the sanity check I added to wp-includes/js/tinymce/plugins/media/editor_plugin.js

I changed

d=e.content

to

d=(e.content?e.content:'')

Note that wp-includes/js/tinymce/wp-tinymce.js.gz will also have to be rebuilt, as it contains the script above.

#6 @westi
12 years ago

You can get the TinyMCE source in the development download of 3.3.9.3 from upstream here http://tinymce.moxiecode.com/download/download.php

#8 @filosofo
12 years ago

Yes, that looks like it.

#9 @nacin
12 years ago

  • Keywords reporter-feedback removed
  • Owner set to koopersmith
  • Status changed from new to assigned

Some list table javascript is messing with TinyMCE. koopersmith is working on a fix.

@koopersmith
12 years ago

@koopersmith
12 years ago

#10 @koopersmith
12 years ago

  • Keywords has-patch added

Currently, the list table JavaScript resets all forms whenever a page is loaded. This is heavyhanded code.

In this case, it caused TinyMCE to break in IE8 while it was in the process of loading.

However, a reset of some sort is necessary. Without a reset, if you change various inputs on the page (i.e. search and filters) and refresh, the results will be reverted to the default, but the inputs will not. The solution I used was to selectively reset form values—only those found within the tablenav, search-box, and wp-list-table classes.

#11 @nacin
12 years ago

  • Keywords commit added

#12 @ocean90
12 years ago

Patch works for me, thx koopersmith.

#13 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [17239]) Selectively reset list-table forms rather than all forms to avoid stompage. Props koopersmith. fixes #16098

Note: See TracTickets for help on using tickets.