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

WordPress Trac noreply at wordpress.org
Wed Mar 27 21:51:17 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:  dev-feedback needs-testing has-patch  |
--------------------------------------------------+-----------------------
Changes (by azaozz):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Seeing some inconsistencies in 16215.12.diff:

 - If we are saving a new revision after saving the main post (the change
 of filter in default-filters.php), there's no need to use `get_post_meta(
 $post['ID'], '_edit_last', true );` in _wp_post_revision_fields(). In this
 case the revision will be exact copy of the last saved post and will have
 the right author. This also is not needed for autosaves, they use
 _wp_post_revision_fields() too.
 - Each time we do:

 {{{
 if ( $revisions = wp_get_post_revisions( $post_id ) ) {
         // grab the last revision
         $last_revision = array_shift( $revisions );
 }
 }}}

 the `$last_revision` could be an autosave. In some cases that works, in
 other, not.
 - `_wp_upgrade_revisions_of_post()` seems to be running each time a post
 is loaded for editing. It needs to run only once per post and update the
 revisions versions. Also some of the logic there is "backwards" :) First
 we save a revision, then check if the post_type supports revisions...

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


More information about the wp-trac mailing list