[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
Fri Jun 3 23:51:19 UTC 2016


#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             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  javascript
-------------------------------+------------------------------

Comment (by azaozz):

 > Wait, are you saying it brings the post content that you've edited or
 the post content that was available as of the last recorded db revision

 Test it in trunk now, after [37619]. When the user clicks the Back button
 it loads the post as last saved on the server, then the "disaster
 recovery" in session storage kicks in and offers to restore post_content
 to the last state saved there. This is (should be) the same as the very
 last content the user submitted for saving.

 > but it feels so dirty and prone to breaking. Ughhh. :(

 Huh, why? That's exactly what you're doing now (as far as you describe it
 and I understand it): when the user attempts to save an "improper" post
 you're blocking it by calling wp_die(). This is pretty bad UX :)

 Best would be to use JS for the validation and run it before the form is
 submitted. If you want to do in in PHP, you can improve the UX
 significantly by returning the rejected content to the user and showing
 error message(s) what is wrong, so they can fix it and save. To do that
 you need to keep that rejected content until the page is reloaded after
 the first saving attempt. That's all :)

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


More information about the wp-trac mailing list