WordPress.org

Make WordPress Core

Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#22755 closed defect (bug) (fixed)

Re-adding TinyMCE to textarea renders visual editor invisible - fixed upstream

Reported by: Marko-M Owned by: azaozz
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: TinyMCE Keywords:
Focuses: Cc:

Description

Wordpress 3.5 RC3 includes TinyMCE 3.5.7. TinyMCE doesn't like to be moved around in DOM and this can be solved only by removing TinyMCE from element before any DOM manipulation. Unfortunately TinyMCE 3.5.7. contains bug that prevents removing TinyMCE instance before doing DOM manipulation and then re-adding it back. Bug is that re-adding TinyMCE causes visual editor span to have "display: none;" CSS appended (becomes invisible).

Here's link to official bug report and solution:

http://www.tinymce.com/develop/bugtracker_view.php?id=5510

There is also link to commit that fixes this problem:

https://github.com/tinymce/tinymce/commit/a12d6859e81408b12c956c3504b1fe7ff35aabae

Bug has been fixed upstream. I can also confim that issue has been resolved in TinyMCE 3.5.8 version. It would be great if this could make into WordPress 3.5.

Attachments (1)

tinymce-3.5.8.patch (521.9 KB) - added by azaozz 17 months ago.

Download all attachments as: .zip

Change History (11)

comment:1 markjaquith17 months ago

  • Owner set to azaozz
  • Status changed from new to assigned

azaozz — your call on this one.

comment:2 nacin17 months ago

TinyMCE has *always* had DOM movement issues, so I wouldn't mind too much if this waited for 3.6. Or was this hiding aspect new in 3.5.7?

Here's a full changelog of 3.5.8 (with my commentary) —

  • Fixed bug where html5 data attributes where stripped from contents. (This is bad, but does this apply to us?)
  • Fixed bug where toolbar was annouced multiple times with JAWS on Firefox. (Nice fix.)
  • Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode. (This sounds like it would affect us, but is minor.)
  • Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty. (WP's TinyMCE Advanced only, sounds like.)
  • Fixed bug with auto detection logic for youtube urls in the media plugin. (Media plugin only.)
  • Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery. (We don't use this version, correct?)
  • Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks. (Yeah, that's no fun.)
  • Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element. (We don't use this plugin.)
  • Fixed bug where toggling of blockquotes when using br enter mode would produce an exception. (Do we use br enter mode?)
  • Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level. (?)
  • Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8. (No idea what this is.)

I don't even see this commit referenced in the changelog. The one that bothers me is the stripping of HTML5 data attributes.

comment:3 Marko-M17 months ago

Problem isn't anything new with moving in DOM, but in TinyMCE version 3.5.7 there is a bug that prevents us from detaching from DOM element and reattaching again to circumvent well known TinyMCE DOM manipulation issues. This hiding on reattach issue hasn't been present in TinyMCE 3.5.6 and isn't present in 3.5.8, so yes it is 3.5.7 specific. Any version except 3.5.7 would solve this issue.

comment:4 georgestephanis17 months ago

Does core use that method to unattach it and then reattach it anywhere? Or is this only for plugins that try it?

comment:5 follow-up: nacin17 months ago

Does core use that method to unattach it and then reattach it anywhere?

No.

comment:6 in reply to: ↑ 5 Marko-M17 months ago

Replying to nacin:

Does core use that method to unattach it and then reattach it anywhere?

No.

I hope this will not eliminate this bug from being fixed for the next release because having to bundle own tinymce copy would complicate my life, as well as lives of other WordPress developers using that functionality. Whatever you decide, thanks for your work.

comment:7 azaozz17 months ago

Tested TinyMCE 3.5.8, all seems to work well. There aren't many changes 3.5.7 -> 3.5.8 so chances for breaking external plugins is quite small.

azaozz17 months ago

comment:8 azaozz17 months ago

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

In 23090:

Upgrade to TinyMCE 3.5.8, fixes #22755

comment:9 dd3217 months ago

  • Milestone changed from Awaiting Review to 3.5

comment:10 Marko-M17 months ago

Thanks azaozz and everyone, with version from trunk all works once again.

Note: See TracTickets for help on using tickets.