Open katag9k opened 10 months ago
@katag9k, @GaryJones after some more testing it appears that this PR may be missing the condition when the post lock is removed via JS/Ajax. Adding the following appears to resolve it, but the two conditionals could likely be combined.
Thoughts?
// Do not filter the avatar if this is doing a heartbeat request on WP refresh lock
if ( wp_doing_ajax() && isset( $_POST['action'] ) && $_POST['action'] === 'heartbeat' ) {
return $args;
}
@katag9k The merge conflict will need addressing please, as well as considering Brooke's comment.
@BrookeDot Thank you, PR updated with the suggested code.
@GaryJones We are conflict free.
Description
Fixes filtering issues when a user has the same id as a guest-author post id on the post list screen, profile screen and the post edit takeover pop-up.
Related: #960 #973 #974
Steps to Test
Create a guest user that has the same
post_id
as another WPuser_id
.In one browser, log in as the WordPress user and edit a post. In another browser login as the guest user. While logged in as a guest user, go to the post list at
/wp-admin/edit.php
the post will be locked as it's being edited by the WordPress user, however, the incorrect guest user's gravatar will be displayed.Correct avatar should be:
Click edit on the post that is being edited, the warning popup will also have the incorrect gravatar from the guest user.
Correct avatar should be:
Take over the post editing. Go back to the browser where the Guest User was editing the post and wait for the "Somone else has taken over this post" pop-up. The incorrect avatar will be displayed:
The correct avatar should be:
Now log in as the WordPress user and go to the profile page at
/wp-admin/profile.php
the incorrect gravatar is displayed.The correct avatar for the WordPress user: