Skip to content
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

Canonical: Validate NOT EXISTS tax_query does not error #3530

Conversation

kadamwhite
Copy link
Contributor

As discussed in 55955, a NOT EXISTS tax_query causes a warning (PHP <= 7.4) or an error (PHP >= 8.0) in the redirect_canonical function because there is a count( $tax_query['terms'] ) check in that function that does not verify whether the terms property is present. It will not be present in NOT EXISTS queries because there is no purpose in specifying individual terms when we are querying for posts which have no terms at all.

Trac ticket: https://core.trac.wordpress.org/ticket/55955


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@kadamwhite kadamwhite force-pushed the 55955-not-exists-tax-query-canonical-error branch from ff49093 to 8546e08 Compare October 27, 2022 13:27
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

tests fail without the changes to src, see https://github.com/WordPress/wordpress-develop/pull/3596/checks

@peterwilsoncc
Copy link
Contributor

peterwilsoncc commented Nov 10, 2022

@MiguelAxcarHM are you able to link your WordPress.org account to your GitHub account so I can ensure you are given props correctly? This can be done in the GitHub username section of https://profiles.wordpress.org/me/profile/edit/group/1/

Edit: I found Kadam's mention of you in the ticket so gave you props on this but linking your account will help for future contributions.

@peterwilsoncc
Copy link
Contributor

@MiguelAxcar
Copy link

Done @peterwilsoncc , thank you! :)

@kadamwhite kadamwhite deleted the 55955-not-exists-tax-query-canonical-error branch June 27, 2023 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants