[wp-trac] [WordPress Trac] #30854: `wp_insert_post` doesn't save revision for new published post

WordPress Trac noreply at wordpress.org
Thu Nov 18 19:20:52 UTC 2021


#30854: `wp_insert_post` doesn't save revision for new published post
-------------------------------------------------+-------------------------
 Reporter:  JamesDiGioia                         |       Owner:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.9
Component:  Revisions                            |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests has-        |     Focuses:
  testing-info needs-testing needs-dev-note      |
-------------------------------------------------+-------------------------

Comment (by TimothyBlynJacobs):

 Replying to [comment:41 adamsilverstein]:
 > > It also looks like there are a couple of REST API tests that will need
 to be updated. The only one that might be a functionality change we are
 concerned about is WP_Test_REST_Revisions_Controller::test_get_item.
 >
 > Do you see these tests failing?

 Yes, they're failing on the PR.

 > > It seems like the revision no longer has author information?
 >
 > Interesting, I would expect that to come from the saved post, but
 perhaps it comes from current_user which might not be set for something
 like an import. This might be ok in that case. How does it show in the UI?
 Any issues when restoring the revision (I wouldn't think so because the
 author would become the current user)?

 The REST tests create the post in the setup where IIRC there isn't a
 current user set. I'm not sure if it is causing any breakage in the
 revisions screen, but does seem incorrect to me.

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


More information about the wp-trac mailing list