[wp-trac] [WordPress Trac] #16215: Post Revision history displays the incorrect author

WordPress Trac noreply at wordpress.org
Thu Mar 28 16:15:21 UTC 2013


#16215: Post Revision history displays the incorrect author
-------------------------------------+-----------------------
 Reporter:  mdawaffe                 |       Owner:  westi
     Type:  defect (bug)             |      Status:  reopened
 Priority:  normal                   |   Milestone:  3.6
Component:  Revisions                |     Version:  2.6
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |
-------------------------------------+-----------------------

Comment (by azaozz):

 > think you still need the wp_save_post_revision( $post->ID ); line...
 so the last post save data gets stored and can have its author data
 updated...

 What's happening at the moment is:

 - New (last) revision is created matching the post data.
 - That revision has post_author set from post_meta '_edit_last' (so the
 author is correct) and `-v1` in post_name.
 - When we get to the conversion code block, this revision is bypassed
 with:
 {{{
 // 1 is the latest revision version, so we're already up to date
 if ( 0 < $this_revision_version )
     continue;
 }}}

 We can still add that before the conversion but it won't affect it. I see
 it's convenient to have this in `_wp_upgrade_revisions_of_post()` so once
 that function runs, all the needed conversions are done.

 Seems good place for it is right after we check whether the revisions for
 the current post have been converted so it doesn't run all the time. Then
 `$revisions = wp_get_post_revisions( $post->ID );` is already set and we
 won't look at it while converting the rest of the revisions.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16215#comment:70>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list