[wp-trac] [WordPress Trac] #32273: TinyMCE results in lost data if post save fails and back button is clicked

WordPress Trac noreply at wordpress.org
Wed May 6 22:51:30 UTC 2015


#32273: TinyMCE results in lost data if post save fails and back button is clicked
--------------------------+-----------------------------
 Reporter:  archon810     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  TinyMCE       |    Version:  4.2.1
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
--------------------------+-----------------------------
 Here's a pretty annoying and destructive behavior that I'd like to figure
 out how to address.

 Consider a scenario where an error occurs when you submit an update (let's
 say what's about to become revision 2) to a post (revision 1). When you
 click Back to go to the previous screen, expecting your updated version
 (2) to still be there, you'll actually observe that the original revision
 is there instead (1), thus losing your changes to 2 entirely.

 That's exactly what's happening to us because of a content validation
 function that returns a wp_die() with a relevant error message displayed
 to the writers when an error is detected (there is a set of house rules,
 like no hotlinking of images, no double spacing, etc.). The idea is that
 if an error is detected, a message is shown, the error is corrected, and
 only then is the post allowed to save.

 So what is causing the revision that was there when the page originally
 loaded rather than the most recently entered text to show up when you
 return to the page? Is that TinyMCE logic clobbering what one would expect
 to be saved submitted form data?

 Is there a workaround to disable this behavior?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32273>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list