-
Notifications
You must be signed in to change notification settings - Fork 182
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
Fixed taxonomy field load/save function to get right post id if field… #401
base: master
Are you sure you want to change the base?
Conversation
… is located in a block
Hi @highbelt - Thanks so much for this PR. You wouldn't believe it, but I'm actually working on this exact issue right now, ha! |
Hi @elliotcondon - just figured out, this solution seems to be not working for taxonomy fields placed inside a repeater field. It only saves the last entry to the post. |
fyi: the current WIP state of 5.9.2 breaks this workaround (i downgraded to 9.2.1 again) |
Hi @highbelt 👋. Thanks for the update. You'll notice in our latest release (5.9.2) an initial attempt to add support for this enhancement. Unfortunately, we were not able to find an elegant enough solution to determine the current It is definitely possible for us to determine the current "Object" being edited, and we will continue to investigate this into the future. We also need to consider - and perhaps consult with the community - whether or not a Taxonomy field within a Block may save data outside of the block scope. This may set a precedence which causes us issues in the future, so we will want ot be double sure that everyone is "for" and not "against". Will keep you updated on the progress. |
After the update of 5.9.2 and 5.9.3 broke the workaround, here is a (more) update proof solution until this topic gets „fixed“.
@elliotcondon regarding your thoughts and concerns on implementing this behavior in general: |
Hi @highbelt. Thanks for the update. Does your above code cause any issues when loading field values within the field's render function/callback? |
… is located in a block
If Taxonomy field is added to a block, the method acf_get_post_id_info() tries to get the right post id but fails because of the unrecognized syntax „block_38u4ndfd8“ of $post_id. Means taxonomy terms are not loaded from/saved to the post/page.
Tried to implement it in a way that all cases are covered: save, update, auto-save, load, ...
If there is a better/more robust way to get the (parent) Post ID in this part of code i'm happy to hear about.