• Resolved gestad2019

    (@gestad2019)


    I have custom fields created with ACF for accounts and when I filter the dropdown select shows different ways of writing the same value: the label, the slug and something that looks like json like on the examples below.
    We are using recent versions of WP / ACF / Admin columns Pro

    The ‘json’ options don’t really give any result and the Label and Name options give different results even though they look related to the same value.

    Any thoughts about this issue?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Stefan van den Dungen Gronovius

    (@dungengronovius)

    Did you use the specific ACF column type for your column, or did you use the Custom Field column? When using the specific ACF column, I won’t expect this behavior to happen. Might it be the case that you switched from a single Select field to a multiple field?

    Thread Starter gestad2019

    (@gestad2019)

    On ACF settings, the custom field is a checkbox with no fancy parameters. There’s just a list of options. I tried the ACF column as I was using the Custom Field one (BTW thanks for the hint) and it’s outputting different results. I’ve checked in the DB for the user meta field and actually what I previously had was actually the reality of the values… It’s a mess between slugs, readable labels and json :-/.
    You’re probably right to point that we might have switched single and multiple select.

    I’ve just tried to edit an account in the user page and checking in DB proved that ACF is also using json (not surprising) so in the DB it changed from Air Austral to a:1:{i:0;s:11:"Air Austral";}.

    As far I understand, changing the field type induced a mess in the DB and I should change everything from readable label or slug to json value.

    What do you think ?

    Plugin Author Stefan van den Dungen Gronovius

    (@dungengronovius)

    Yes, you’re right. When you change the field type in ACF from a single Select to a Checkbox for example, the way the data is stored also changed, resulting in inconsistent data storage. Although for display purposes, this can quite easily be fixed in the logic to display it, in order for our (pro) features to work, it does matter which format is used, so the data must be consistent.

    In such cases as yours, I would probably run an update script to make sure the storage of that specific field is consistent, in this case, stored as JSON. Or if you have a small dataset, you could consider using a different key, but of course, that will leave you with unused deprecated values in your database for a key that no longer exists.

    Thread Starter gestad2019

    (@gestad2019)

    thanks Stefan for considering my issue. I’ll mark it a completed as I just have to update the DB with SQL. I’ve started and AC is rendering in the right way.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Confusing display in a dropdown’ is closed to new replies.