-
Notifications
You must be signed in to change notification settings - Fork 7
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
refactor meta key allowed check #163
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.
@pschoffer Makes sense of a re-factor! Just a few minor notes added, but I think we should PR this upstream first so that we can try to be as close to upstream as possible when we sync.
Upstream change: 10up#2862 |
Co-authored-by: Rebecca Hum <16962021+rebeccahum@users.noreply.github.com>
Co-authored-by: Rebecca Hum <16962021+rebeccahum@users.noreply.github.com>
Hopefully we can get the upstream change in 10up#2862 and then pull that in instead. |
I checked with 10up and they plan to merge the upstream PR next week. The code has quite diverged there so it can't be cleanly cherry-picked, but I try to sync it as much as I could. This is now ready I think. |
Description
When meta key is deleted from a post, this does NOT trigger reindex of that post due to the way of allowed metas are detected.
This change makes it so that we have the logic that evaluates if given meta_key is allowed separate from the logic that prepares metas for indexing. That way we can trigger even for meta key that is not being prepared to indexed (because it was just deleted) but is allowed to be in index (was in the indexed document before).
Checklist
Please make sure the items below have been covered before requesting a review:
Steps to Test
vip dev-env exec -- wp post meta set 1 testing foobar
vip dev-env exec -- wp vip-search documents get post 1 --format=json | jq '.[0].meta'
vip dev-env exec -- wp post meta delete 1 testing
vip dev-env exec -- wp vip-search documents get post 1 --format=json | jq '.[0].meta'