WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10515 closed defect (bug) (fixed)

TinyMCE spellchecker markup disappears during auto-save

Reported by: rsmudge Owned by: AO
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.8
Component: TinyMCE Keywords: upstream
Focuses: Cc:

Description

The WordPress spell checker strips the spellchecker markup during an auto-save event.

How to reproduce?

  1. Type: "I can't spel, AO plz help." into the WordPress Visual Editor
  2. Click the spellcheck button.
  3. Wait for the auto-save.

What happened?

On auto-save the before get content event is fired and the spellchecker removes the markup for the misspelled words.

http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor/onBeforeGetContent

This is the only good client side time for the spellchecker to strip its markup from a post. A possible work around is to do the stripping on the server side but this is extremely error prone.

Suggested fix:

Consider updating TinyMCE to pass a why parameter to onBeforeGetContent or at least setting some property readable editor propery before auto-save and unsetting it afterwards. This will allow plugins that choose to look at these values to not strip their markup during an auto-save event.

Attachments (1)

autosave.patch (14.0 KB) - added by azaozz 5 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 follow-up: dd325 years ago

  • Component changed from General to TinyMCE
  • Keywords upstream added
  • Milestone changed from Unassigned to Future Release
  • Version set to 2.9

This ticket needs to be submitted upstream to the TinyMCE bug tracker, That is the only location it can be fixed, WordPress might back-port any changes made to the currently-included editor...

Or WordPress could work around the issue by disabling auto-saves while spellcheckers active...

Setting to Future release pending patch upstream.

comment:2 in reply to: ↑ 1 azaozz5 years ago

Would be good if this is fixed upstream, perhaps when TinyMCE gets native autosave support.

Replying to dd32:

Or WordPress could work around the issue by disabling auto-saves while spellcheckers active...

There's actually a check in autosave whether the spellchecker is active but it doesn't stop tinyMCE.save() that is resetting it (autosave would still run to keep the post lock).

Attaching a patch that will need some more testing for all cases: new post, adding media, concurrent editing to make sure the post is locked properly at all times, etc.

azaozz5 years ago

comment:3 azaozz5 years ago

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

(In [11790]) Don't do autosave while the TinyMCE spellchecker is active (it strips all the markup), fixes #10515

comment:4 azaozz5 years ago

  • Milestone changed from Future Release to 2.9
  • Version changed from 2.9 to 2.8
Note: See TracTickets for help on using tickets.