Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#27416 closed defect (bug) (fixed)

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

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

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 11 years ago.

Download all attachments as: .zip

Change History (6)

#1 @gcorne
11 years ago

  • Description modified (diff)

#2 @gcorne
11 years ago

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

@gcorne
11 years ago

#3 @gcorne
11 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.


11 years ago

#5 @wonderboymusic
11 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to 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.