-
Notifications
You must be signed in to change notification settings - Fork 313
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 #2862
refactor meta key allowed check #2862
Conversation
36458d9
to
964292a
Compare
964292a
to
f689d29
Compare
👋 @felipeelia I added a test, change few typos and switched the version. Please, let me know if that is what you meant in slack. |
Hey @pschoffer, thanks for the changes. The PHP Lint action detected a warning with a space alignment, do you mind fixing that before we merge it? Also, is there any reason why you decided to not call maybe_unserialize on values in filter_allowed_metas()? I imagine that was because of how things were named but wanted to confirm. |
Co-authored-by: Felipe Elia <felipe.elia@gmail.com>
Hi @felipeelia , My thinking around
|
Description of the Change
When a 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).
Alternate Designs
Possible Drawbacks
Verification Process
(sorry the steps are specific to our dev-env, but I guess they still make sense?)
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'
Checklist:
Changelog Entry
Fixed - Post reindex on meta deletion
Credits
@pschoffer