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

Second pass at Fix a rare edge-case bug where invalid values in tax_query terms resulted in a broken query by passing terms array via array_filter to remove false and null #2583

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

rinatkhaziev
Copy link
Contributor

Description of the Change

#2576 contained an error where filtered array wasn't passed through array_values to reset the keys, leading to json_encode treating it as object rather than array, this again resulted in a broken query.

This PR addresses that and includes the tests.

Alternate Designs

Possible Drawbacks

Verification Process

See the original PR for steps to test.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Credits

Props @

…uery terms resulted in a broken query by passing terms array via array_filter to remove false and null (now with tests)
@rinatkhaziev
Copy link
Contributor Author

The failing test seems to be

1) ElasticPressTest\TestPost::testStickyPostsExcludedOnNotHome
Failed asserting that 'Sticky post' is not equal to 'Sticky post'.

tests/php/indexables/TestPost.php Outdated Show resolved Hide resolved
@felipeelia felipeelia merged commit 02d5b64 into 10up:develop Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants