I’m having trouble with this as well. I had to downgrade 26 client websites to 5.7.7 in order for my clients to be able to publish posts/pages with ACF field groups.
Anyone had the chance to test of this is fixed in 5.2.2?
I’ve notified the support team of ACF which has in turn notified the developer. The support team suggested downgrading to 5.1.8 until the bug has been fixed.
I’m having this problem as well on multiple live client sites. Now I need to either downgrade or make fields optional. This bug was not present on 5.1.7.1, for example.
Haven’t hade the time to try it out until now.
Just to back up a bit: I’m trying to compare the new value of a field to its previous value. To be able to do this I need to know the field name/key, the previous value, and the new value. To get the previous value, I need to know the post ID of the post that’s being saved.
When trying out the acf/validate_value/name=[field_name]
action, I can’t get the post ID since the action only returns the following four arguments: $valid, $value, $field, $input.
So, @Elliot Condon, any way to get the post ID inside acf/validate_value/name=[field_name]?
It’s very annoying since it keeps me from upgrading several client’s sites to ACF PRO. I will try to get Elliot Condon’s attention on this problem.
What I’m trying to do is compare the old and new values of a field when a post is saved using acf/save_post with priority 1, which is supposed to run before ACF saves the $_POST[‘acf’] data.
The field values always comes out equal, which they are not supposed to do, right?
Example data:
field_abc123 old value: Title One
field_abc123 new value: Title Two
Example code:
function compare_field_values($post_id) {
// Print old and new field values
var_dump(get_field('field_abc123', $post_id);
var_dump($_POST['acf']['field_abc123']);
// Exit to be able to debug the field values
exit();
}
add_action('acf/save_post', array($this, 'compare_field_values'), 1);
So, anyone have any idea on how to solve this? Or is there a bug in ACF when setting the priority to 1 on acf/save_post?
Is someone looking into this? It was reported 1,5 month ago and keeps me from upgrading several sites from ACF 4 to 5.
Bumping this since it’s unread…
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.