[wp-trac] [WordPress Trac] #50754: REST updating a post without author support updates the author to the current user

WordPress Trac noreply at wordpress.org
Fri Jul 24 10:53:26 UTC 2020


#50754: REST updating a post without author support updates the author to the
current user
--------------------------+-----------------------------
 Reporter:  jadpm         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When updaing a post using the REST API, if the post belongs to a post type
 that does not support post author, then the database entry for the post
 gets updated and the current user is set as author.

 Steps to reproduce, using the Blocks editor as REST API cover:
 * Register a post type and make sure you do not declare support for post
 author.
 * Create a new post for that type using the blocks editor, and notice that
 the databse entry for it sets the author to be the current user.
 * Switch to another user with proper editing capabilities, and edit the
 post again also using the post editor.
 * Upong saving, confirm that the database entry for the post states that
 th author is this second user.

 This does not happen when updating a post manually using the legacy
 classic editor: in this case, the author set when first creating the post
 is respected on following edits.

 Although this might be considered a minor thing (the post type should not
 be supporting author logic, right?), the implications reach deeper. Users
 set as the post author in the database get notifications on new comments,
 for eample, despite the author support for their post type. Having them
 modified inconsistently based on the editor used to adjust the content
 copy introduces a major editorial flow nightmare in sites maintained by
 multiple users.

 Probably related: #47041

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


More information about the wp-trac mailing list