[wp-trac] [WordPress Trac] #61653: new post draft not preserved when submission fails

WordPress Trac noreply at wordpress.org
Mon Jul 15 13:45:04 UTC 2024


#61653: new post draft not preserved when submission fails
--------------------------+-----------------------------
 Reporter:  r00t2         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 one of the worst user experiences is when data entered into a browser is
 lost and has to be re-entered.
 wordpress normally avoids this in the post editor by storing the draft
 both server and client-side, and offering to restore it when the same post
 is edited again.

 but this does not seem to work on initial creation of a new post in some
 corner-case(s).

 steps:
 * log out
 * open two windows/tabs with /wp-admin/post-new.php , they will redirect
 to wp-login.php (no link is provided to not-logged-in users, but assume
 it's bookmarked.)
 * login on both of them
   (note: this leads to the second login invalidating the first one, or at
 least it's xsrf token, that may or may not be a separate bug.)
 * in the one where you logged in first, draft a post and click publish.
 * you are redirected to the login form, or shown an "The link you followed
 has expired" error message

 expected result:
 * after logging in, the draft content is published or preserved

 actual result:
 * you are redirected to a blank editor, the draft is lost and one you have
 to restart from scratch (neither re-submitting nor back-buttoning to post-
 new.php helps)

 (the draft could not be stored server-side due to the invalid session, and
 the client-side mechanism does not catch this case either, the generic
 pattern to pass all form fields through the login process on a POST with
 no valid session is not used.)

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


More information about the wp-trac mailing list