im using latest version of ACF pro. On one website we are using more fields than normaly 14 fields in few tabs.
On this page im using select for country flags (https://github.com/lipis/flag-icon-css).
Everything is working fine, except for the flags, the value is not saving. Each time i come to post value is reseted => no flag is showing.
I’m receiving this notices:
PHP Notice: Undefined index: operator in .../advanced-custom-fields-pro/core/location.php:87 PHP Notice: Undefined index: operator in .../advanced-custom-fields-pro/core/location.php:91
Can you please help me?
Thanks for your time! 🙂
The field is used to return country code.
AF : Afghanistan
AX : Åland Islands
AL : Albania….
On my page first few was working at the begining. As we added more field, this field is not updating. After refresh in post admin ill always end on same value. In case of new entry Afganistan, because its first in select. If i want edit old one it will stay on previous value.
Rest of the fields is working fine.
All other fields than this select are saving values.
This select is not saving any values. Thats why it’s not printing anything to frontend – i mean flags.
We are not using any cache plugins etc on develop environment.
There is only one reason that I can thing of that the value is not saving, or maybe it is saving, but something is interfering with it. What is the name of the field? Is that field name duplicated anywhere?
If you have another field with the same name then when ACF attempts to get the field key of the field associated with the select field it could be getting the field key for the other field. This other field probably has a value that’s not listed as part of the select field so it is reverting to the default value.
Field name was called “country_flag”, and i’ve tried more names. It didn’t work. I checked DB and data was to saved to post_meta. I was not using the same name anywhere.
I made a copy (duplicated) the field and changed the name and it worked. Don’t know the reason, but it’s working.
Thanks for ideas and your time!
You must be logged in to reply to this topic.
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!
© 2023 Advanced Custom Fields.