[wp-trac] [WordPress Trac] #56963: Creating new post is using a pre-existing post id
WordPress Trac
noreply at wordpress.org
Wed Nov 2 18:38:23 UTC 2022
#56963: Creating new post is using a pre-existing post id
-------------------------------+------------------------------
Reporter: danielcho | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 6.0.3
Severity: major | Resolution: invalid
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by danielcho):
* status: new => closed
* resolution: => invalid
Comment:
Replying to [comment:1 azaozz]:
> > a user creates multiple new posts in a short time frame, the post id
for all of these new posts is all the same
> > ...
> > a user creates a new post (either just opening the page and leaving or
saving and publishing it), and then tries to create another new post
(either in a new tab or in the same tab) the post id for the second new
post will remain the same as the first new post
>
> Could you confirm if that happens when the user creates the second post
after the first has been published (assuming there was some content in it
or at least a title)?
>
> The way new posts are created is as follows:
> 1. User opens the New Post screen => WP creates a special post type
(auto-draft) and inserts it in the DB.
> 2. User adds a title or starts to type in the new post => WP auto-saves
the post and converts it to a standard draft (removes the auto-draft
type). At this point the post can be seen by other users on the Posts
screen, they can "take over" and edit it, etc.
>
> Also posts with no title and no content are considered "invalid" or
"user error". These happen sometimes when a user opens the New Post screen
but then goes away or just quits the browser. Because of that opening
several New Post screens in separate tabs by the same user (without
entering anything in them) may reuse the same auto-draft (same post ID).
Guessing that at the back-end that looks like the user reloading the same
screen several times.
>
> A better workflow would be if a draft is saved for each new post (by
clicking the button) before another is started. Then WP will change the
type of the first post to a standard draft. (Of course this only applies
when the same user wants to create many new posts very fast. Posts by
different users can be made concurrently.)
I'm so sorry, we actually found the cause of the issue was a plugin that
we missed originally while testing with plugins off. I'll close the ticket
now. Sorry again!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56963#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list