-
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: disambiguate WP users vs. guest authors with same ID #1143
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 fixes the issue. Noting that the Author List block should also be updated – added #1150
# [1.52.0-alpha.1](v1.51.0...v1.52.0-alpha.1) (2022-06-02) ### Bug Fixes * correct donate block tab spacing in editor ([#1153](#1153)) ([c17221f](c17221f)) * disambiguate WP users vs. guest authors with same ID ([#1143](#1143)) ([d3c5920](d3c5920)) * echo closing link tags on sponsor bylines ([#1152](#1152)) ([f80893f](f80893f)) * remove custom column block styles ([#1133](#1133)) ([bd79783](bd79783)) * skipped linked images when navigating blocks by keyboard ([#1144](#1144)) ([8975787](8975787)) ### Features * add new subscribe pattern ([#1142](#1142)) ([97d632e](97d632e)) * remove support for the Aside post format ([#1139](#1139)) ([9f9cdf4](9f9cdf4))
🎉 This PR is included in version 1.52.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [1.52.0](v1.51.0...v1.52.0) (2022-06-13) ### Bug Fixes * correct donate block tab spacing in editor ([#1153](#1153)) ([c17221f](c17221f)) * disambiguate WP users vs. guest authors with same ID ([#1143](#1143)) ([d3c5920](d3c5920)) * echo closing link tags on sponsor bylines ([#1152](#1152)) ([f80893f](f80893f)) * remove custom column block styles ([#1133](#1133)) ([bd79783](bd79783)) * skipped linked images when navigating blocks by keyboard ([#1144](#1144)) ([8975787](8975787)) ### Features * add new subscribe pattern ([#1142](#1142)) ([97d632e](97d632e)) * remove support for the Aside post format ([#1139](#1139)) ([9f9cdf4](9f9cdf4))
🎉 This PR is included in version 1.52.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Accounts for a previously unhandled edge case where a CAP guest author and a WP user might have the same numeric ID in the DB. In this case,
master
will always choose the guest author over the WP user because we can't tell which type of author to fetch with only the ID.This PR fixes the above issue by storing a new block attribute
isGuestAuthor
as part of the Author Profile block. If this istrue
(the default), the block's behavior will behave as it currently does (search guest authors first, and if none found, fall back to WP users). If it'sfalse
, it will only search WP users. This ensures that if a WP user is chosen which has the same ID as a CAP guest author, the WP user will be displayed in the editor and the front-end.Note that this doesn't fix pre-existing instances of the Author Profile block affected by this issue, as there is no way to disambiguate the numeric IDs without the new
isGuestAuthor
attribute. These blocks will need to be manually rebuilt in the editor.This PR also standardizes REST API parameters as snake case and properly lists and sanitizes all possible param values in the REST route registration. Otherwise, the Author List and Author Profile behavior should remain the same.
Closes #1134.
How to test the changes in this Pull Request:
wp site empty --yes
at CLI and then create a guest author, the ID will be1
and the same as the main admin user.Other information: