-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix avatar collision on profile, post and edit screens #996
base: develop
Are you sure you want to change the base?
Conversation
@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?
|
@katag9k The merge conflict will need addressing please, as well as considering Brooke's comment. |
…mattic/Co-Authors-Plus into fix-takeover-popup-avatar-collision
@BrookeDot Thank you, PR updated with the suggested code. @GaryJones We are conflict free. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this PR, we've now got a whole lot more exceptions to the rule than whatever circumstance the rule was meant to be.
Can you work out where the RIGHT places are that should be filtered, and just target those?
} | ||
|
||
// Do not filter the avatar if this is doing a heartbeat request on WP refresh lock | ||
if ( wp_doing_ajax() && isset( $_POST['action'] ) && 'heartbeat' === $_POST['action'] ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a nonce that can be verified here for the heartbeat?
(PHPCS failure)
Co-authored-by: Gary Jones <[email protected]>
Co-authored-by: Gary Jones <[email protected]>
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: