Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#61653 closed defect (bug) (duplicate)

new post draft not preserved when submission fails

Reported by: r00t2 Owned by:
Priority: normal Milestone:
Component: Editor Version:
Severity: normal Keywords:
Cc: Focuses:

Description

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.)

Change History (2)

#1 @r00t2
2 years ago

this seems to be similar to https://core.trac.wordpress.org/ticket/27916 (which is ten years old and unresolved)

Last edited 2 years ago by r00t2 (previous) (diff)

#2 @hellofromTonya
2 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed
  • Version 6.6

Hello @r00t2,

Welcome to WordPress Core Trac.

Yes, the issue you're raising is the same / related to #27916. To keep the discussion in one place, I'm closing this ticket as a duplicate of that one.

Thank you

Note: See TracTickets for help on using tickets.