Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#27416 closed defect (bug) (fixed)

Tinymce wpviews cause a undo loop that inhibits the user from undoing changes

Reported by: gcorne Owned by: wonderboymusic
Priority: high Milestone: 3.9
Component: Editor Version: 3.9
Severity: normal Keywords:
Cc: Focuses: javascript

Description (last modified by gcorne)

When a post has one or more wpviews, it is possible to get the editor in a state where previous changes cannot be undone via ctrl+z / command+z.

To reproduce,

  1. Create and save a post with at least one gallery and a block of text before and after.
  2. Cut some of the text and paste it somewhere.
  3. Try to undo twice.

Expected:
The pasted text to be removed and the cut text to be restored.

Actual:
The pasted text is removed, but the cut text is not restored.

This occurs when wp.mce.views.render() is called and updates the DOM. See line 143 in the wpview plugin.

Attachments (1)

27416-01.patch​ (718 bytes ) - added by gcorne 13 years ago.

Download all attachments as: .zip

Change History (6)

#1 @gcorne
13 years ago

  • Description modified (diff)

#2 @gcorne
13 years ago

  • Description modified (diff)
  • Summary Tinymce wpviews cause a undo loop of sorts that inhibits the user from undoing changes → Tinymce wpviews cause a undo loop that inhibits the user from undoing changes

@gcorne
13 years ago

#3 @gcorne
13 years ago

27516-01.patch​ fixes the issue by not (re-)rendering views when the format of content is raw. If the format is "raw", we can assume that the view has already been incorporated into the DOM.

This ticket was mentioned in IRC in #wordpress-dev by wonderboymusic. ​View the logs.


13 years ago

#5 @wonderboymusic
13 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → closed

In 27544:

MCE Views: don't (re-)render views if the format of the content is "raw" to avoid adding additional undo levels on undo/redo.

Props gcorne.
Fixes #27416.

Note: See TracTickets for help on using tickets.