Opened 12 years ago
Closed 12 years ago
#20982 closed defect (bug) (fixed)
Restoring post revisions does not update _edit_last
Reported by: | redpixelstudios | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.3.2 |
Component: | Revisions | Keywords: | has-patch |
Focuses: | Cc: |
Description
To recreate the problem:
Prerequisites
- A WordPress install with 2 or more users.
- (NOTE: In my particular case, user a was an Author while user b was an Admin. I am doubtful this matters, but I figured I would mention it just in case.)
Algorithm
- Create a new post as user a.
- Modify the post with some minor changes as user b.
- As user a again, view the post. Go to revisions and restore the first post you made.
- View the site and note that while the content has been updated to display the original post, the last modified author reads user b.
Attachments (7)
Change History (24)
#3
@
12 years ago
- Keywords revisions-3.6 removed
- Milestone changed from Awaiting Review to 3.6
Addressing #16215 probably fixes this, if not we should fix this too.
#4
@
12 years ago
- Cc adamsilverstein@… added
westi: i agree #16215 fixes this. lines up with attached patch.
however, i was unable to reproduce bug anyway, either with or without the patch from #16215.
i don't understand the ticket author's last step in reproducing the bug "View the site and note that while the content has been updated to display the original post, the last modified author reads user b." - does the author mean to check the live site, if so my default setup doesn't show a 'last modified author', where is that? if they are talking about the admin revisions list, this looks correct now, shows current user on current revision after restoring any past revision, which seems like correct behavior.
suggest closing this ticket.
#6
follow-up:
↓ 8
@
12 years ago
Confirmed that the bug exists, and that the 16215.4.diff patch addresses it.
One point of clarity: the value of _edit_last
will be set not to the ID of the author of the restored revision, but to the ID of the user that restored the revision. This approach seems appropriate, but I wanted to note it here for others to consider.
#7
@
12 years ago
In 1210/tests:
#8
in reply to:
↑ 6
@
12 years ago
I've added Adams test case with some tweaks above.
Replying to ethitter:
Confirmed that the bug exists, and that the 16215.4.diff patch addresses it.
One point of clarity: the value of
_edit_last
will be set not to the ID of the author of the restored revision, but to the ID of the user that restored the revision. This approach seems appropriate, but I wanted to note it here for others to consider.
That sounds right, at the moment the test is wrong for this - I left a note in the test case because I'm not 100% sure it is right at the moment but wanted to get it into the repo so we could iterate on the tests.
#10
@
12 years ago
20982.diff
- stores the current user in _edit_last post meta when restoring revision
#13
follow-up:
↓ 14
@
12 years ago
- Keywords dev-feedback removed
20982.patch moves the line into wp_restore_post_revision()
because it's also called in wp_restoreRevision()
.
#14
in reply to:
↑ 13
;
follow-up:
↓ 15
@
12 years ago
Replying to ocean90:
20982.patch moves the line into
wp_restore_post_revision()
because it's also called inwp_restoreRevision()
.
looks like a good spot for this...
not sure ! $post_id
part needed since
is_wp_error( $post_id )
will return false anyway if
! $post_id
, right?
#15
in reply to:
↑ 14
;
follow-up:
↓ 16
@
12 years ago
Replying to adamsilverstein:
not sure
! $post_id
part needed since
is_wp_error( $post_id )
will return false anyway if
! $post_id
, right?
Marking as a candidate for resolving as part of the work on revisions in 3.6