-
Notifications
You must be signed in to change notification settings - Fork 157
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
Update distributions after post terms and meta is saved. #938
Update distributions after post terms and meta is saved. #938
Conversation
I tried writing an E2E test for this (using tags rather than meta as the UI is already exposed) but I will need some help from some one more familiar with cyrpress. |
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.
@peterwilsoncc Code LGTM but the issue is not regenerating for me in the develop
branch.
Please check the video:
dist-938-not-regenerating.mp4
Let me know if I'm not testing it correctly.
@faisal-alvi Your tests process is correct, so I am unclear why we are seeing different results. I do have the classic editor installed so I wonder if it's an interaction with that. You'll see in the video that the distributed block on xu-distributor.local shows as a classic block. Not in the video, I start on this branch so the values are in sync. The values go out of sync once I switch to develop. https://youtu.be/8grzn3YdWXk |
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.
@peterwilsoncc thanks for the video. I have retried and this time it regenerated for me in the develop
and worked fine in the PR branch.
Description of the Change
This moves the updating of distributions during edits from the
save_post
hook to thewp_after_insert_post
hook.In updates via both the classic and REST API, WordPress fires this hook after all terms and post meta is updated. This prevents the distribution of legacy data described in the issue.
Closes #399
How to test the Change
develop
brancha) Create and distribute a post via the block editor
b) Update the post
c) Check the database -- observe the value of the post meta differs between source and distribution (one less)
Changelog Entry
Credits
Props @peterwilsoncc, @dinhtungdu, @dkotter, @timstl, @faisal-alvi.
Checklist: