-
Notifications
You must be signed in to change notification settings - Fork 43
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: query for CAP terms #1535
fix: query for CAP terms #1535
Conversation
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.
This works as described -- thanks @dkoo! 🚢
Update: this has been confirmed to be caused by a data migration, so the better approach would be to fix the migrated data. |
Reopening because we need more time to clean the data on the affected sites, and this solves the reader-facing issue in the meantime. We can potentially revert the change once the data is cleaned. |
Merging because it was already tested and approved! |
🎉 This PR is included in version 1.75.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Co-Authors Plus author terms for WP users match the WP user's
user_login
at the time of the WP user's creation. Theuser_login
can't be updated in WP once the user is created, so it assumes that these values will always match. But in production environments, we've seen cases where this is not the case: specifically, theuser_login
anduser_email
differ, but the CAP term name matches theuser_email
instead of the `user_login. This seems to be possible only through direct DB manipulation, so I suspect this is happening from data migration. I haven't been able to recreate this scenario in a test site using WP admin, so the risk of it happening seems low for sites that haven't run into it, but it can be a serious issue with no workaround for sites that are affected.How to test the changes in this Pull Request:
release
, using a test site with Co-Authors Plus active, create a new WP "author" user. Make sure theuser_login
is something different from theuser_email
.author
taxonomy term to the posts, as is standard CAP behavior. By default, the CAP term name will match the WP user'suser_login
, which you can verify by runningwp term get author <user_login>
and verifying that term exists. You can also runwp post term list author <post_id>
on any of the posts assigned to the user to verify that this term is assigned to those posts.user_email
:wp term update author <term_id> --name=<user_email>
user_login
.Other information: