Support

Account

Home Forums Bug Reports Values being displayed inconsistantly

Solving

Values being displayed inconsistantly

  • Hello!

    So i’ve been using ACF for a few years with minimal issues other than the usual learning curbs.

    I’ve ran into something recently that’s stumped me so I thought I’d post it here and see if anyone can help/has had a similar issue.

    It’s a simple issue, but its inconsistency is making it really hard to solve.

    I have a pretty basic drop down field with a few values (see screenshot 1).

    I then, on the frontend in my template have this to display the field (see screenshot 2).

    Now for most of the posts, this works fine and as expected, but about 30% of the time, no value displays.

    If I then do an update on that post (without changing anything). It fixes the issue and value displays.

    This is really bugging me as there’s nothing I can work from – please help if you can!

    Thanks, Harry.

  • You didn’t include the screen shots.

    The main questions I would have in any case have nothing to do with what your field looks like or what your code looks like.

    1) How is the content for these fields being added? Is all of the content being added by actually editing the posts in the admin? Or, is there some type of import process being used to add the content?

    2) Assuming that by drop down you mean a select field, does this field allow multiple selections or only one selection?

  • Hi Sorry,

    I’m sure I added the screenshots, I’ll try again on this reply.

  • 1) How is the content for these fields being added? Is all of the content being added by actually editing the posts in the admin? Or, is there some type of import process being used to add the content?

  • The posts are being created by a Gravity Form, using the post update fields.

  • Just to let you know I keep going to this page when trying to post a response, and I have to rewrite my answer which is why it didn’t get posted before – sorry!

  • The problem is that gravity forms is not setting the field key reference for the field. Without this information in the database ACF does not know how to treat the data in the field. For “Basic” fields, this is not a problem because the data is just text. In the case of more advanced fields, like a select field that allows multiple selections, it is a problem. These select fields are stored as serialized arrays.

    Each field in ACF that is stored also has another meta value stored that relates to field name to the field key. For example, if you have a field named “my_field_name” there will be this meta key in the DB and there will be a meta key of “_my_field_name” with a value == the field key for the field.

    You need to talk to support at GF. First you need to make sure that GF is saving the value as a serialized array and second you need to find out from them what you need to do to insert the field key reference into the database.

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

The topic ‘Values being displayed inconsistantly’ is closed to new replies.