[wp-trac] [WordPress Trac] #16215: Post Revision history displays the incorrect author
WordPress Trac
noreply at wordpress.org
Thu Mar 28 13:52:27 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 adamsilverstein):
Replying to [comment:68 azaozz]:
> In 16215-13.patch:
>
> - Always update the revision version when updating the post authors.
> - Check if revisions have been updated and return early in
_wp_upgrade_revisions_of_post().
> - Update the revisions by direct query to avoid resetting
`post_modified` in wp_update_post() and making all revisions show as saved
right now. A lower level API would have been good here :)
> - Removed copying the post to a revision when no revisions exist. Can be
added after this conversion if needed.
>
think you still need the wp_save_post_revision( $post->ID ); line
(removed in 16215-13.patch), but haven't tested yet. i expect removing it
will mess up some data:
the reason is that under the old system there was no revision matching te
current post data, it was always saving the previous, but not the current
post. this line adds a copy of the current post as a revision so the last
post save data gets stored and can have its author data updated (it will
be off initially because the current user might not match the user who
made the last changes).
in other words, this call needs to happen before the revisions data is
corrected, if we do it after we will have one revision with the wrong
author data, or if it doesn't happen before the next update, we will have
a gap with one missing revision as the new system saves a revision after
the post update occurs so no current data revision will ever get saved.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16215#comment:69>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list