-
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: authors and guest authors in homepage posts #1083
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.
I love the work done in 8ddcee8 👏
Also can confirm that it fixes the described bug of unwanted inherited query clauses!
Left a tiny nit below:
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.
🙌
# [1.47.0-alpha.1](v1.46.1...v1.47.0-alpha.1) (2022-03-31) ### Bug Fixes * **author-list:** handle alphabetizing last names containing spaces ([#1057](#1057)) ([1af7e19](1af7e19)) * authors and guest authors in homepage posts ([#1083](#1083)) ([038d9a4](038d9a4)) * donate block non-default styles grid breakpoint ([#1078](#1078)) ([5450e57](5450e57)) * **homepage-posts:** post fetch for widget blocks ([#1066](#1066)) ([3734a3f](3734a3f)) ### Features * add alternate and minimal styles to donate block ([#1068](#1068)) ([3c914d2](3c914d2))
🎉 This PR is included in version 1.47.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [1.47.0](v1.46.1...v1.47.0) (2022-04-05) ### Bug Fixes * **author-list:** handle alphabetizing last names containing spaces ([#1057](#1057)) ([1af7e19](1af7e19)) * authors and guest authors in homepage posts ([#1083](#1083)) ([038d9a4](038d9a4)) * donate block non-default styles grid breakpoint ([#1078](#1078)) ([5450e57](5450e57)) * **homepage-posts:** post fetch for widget blocks ([#1066](#1066)) ([3734a3f](3734a3f)) * incorrect nesting of tax_query args ([#1087](#1087)) ([a613874](a613874)) ### Features * add alternate and minimal styles to donate block ([#1068](#1068)) ([3c914d2](3c914d2))
🎉 This PR is included in version 1.47.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
This PR supersedes #1082. Testing instructions remain the same except for an additional testing step at the end (see bolded header below). 8ddcee8 is the only new commit in this branch vs #1082, if that helps with code review.
Fixes four bugs related to author querying:
include
query param when fetching saved authors to display in the block sidebar controlsHow to test the changes in this Pull Request:
SQL syntax error and linked accounts
master
, add several Homepage Posts blocks to a post and filter them by a regular WP user, a guest author with no linked account, and a guest author with a linked account. For ease of testing, use the same authors in all blocks and add separators between block instances so you can easily see where one block ends and the next begins.Saved authors in block sidebar controls
master
and refresh the editor with your test blocks.Unrelated CAP guest author posts
master
. In one of the test Homepage Posts blocks, filter by the WP user in step 1. Observe that in the editor and on the front-end, the block displays post(s) created by the WP user but assigned to unrelated guest authors.Posts Carousel block
No changes were made to the Posts Carousel block, but it uses some of the same query functions and endpoints, so we should test it in the editor and on the front-end to ensure it still behaves as expected.
NEW TEST CASE: subsequent non-author queries
8ddcee8 introduces a fix for an unsolved bug present in #1082. In that PR, any WP queries after the wpuser+coauthors queries would inherit the
join
andwhere
clause filtering done by those queries, even if the filter callback is removed. This fix now simplifies the use of theposts_clauses
filter callback and preemtively strips all customjoin
andwhere
modifications before each query.hotfix/author-query-in-homepage-posts
, add two Homepage Posts blocks to a page: one with an author filter containing both WP users and CAP guest authors, and the other with no filters.Other information: