Support

Account

Home Forums ACF PRO acf/update_value/key= vs acf/update_value/type=

Solving

acf/update_value/key= vs acf/update_value/type=

  • When using the acf/update_value/key= and acf/update_value/name= filters on a repeater field, the $value is different from when the acf/update_value/type= filter. With the key and name specific filters the $value is always the number of rows within the repeater and with the type filter it’s an array of the row values. It looks to be because the $value variable is modified before getting to the name and key filters when the field type is a repeater in the acf_update_value() function.

    Is there any other way to grab the full array of values for a repeater via a filter by key or field name?

  • Hi @hereswhatidid

    That sounds like a bug to me. The key and name parameters should also return the full array rather than the actual value saved on the repeater field in the DB (the repeater fields saved value IS just the number of rows).

    I’ll assign @elliot to this and we’ll see what he says 🙂

    In the meantime you could use the type parameter and immediately do a check of the field name and just hit return $field; if it’s not correct.

    Something like

    
    
    if($field['name'] != 'blah')
    	return $field;
    
    
  • @jonathan Has there been any development here? I’m running into this same issue after upgrading from ACF 4 to ACF 5.3.1.

  • Hi @kevinsperrine

    Not unless elliot has responded (which I guess he has not).
    He’s doing an insane amount of work on ACF alone and thus any bug notice will take some time to get noticed, tested and fixed 🙂

    For now see my suggested temporary fix.

    Thanks for your understanding!

  • Just run into this issue… Would be great to see a fix rather than a workaround!

  • Hey,

    just run into this too. Looks like it still works the same and has not been solved, right?

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘acf/update_value/key= vs acf/update_value/type=’ is closed to new replies.