Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field Name case change does not reflect in DB #881

Open
redstonescooter opened this issue Nov 4, 2023 · 1 comment
Open

Field Name case change does not reflect in DB #881

redstonescooter opened this issue Nov 4, 2023 · 1 comment

Comments

@redstonescooter
Copy link

Describe the bug
if you change a lowercase letter in the field name to the uppercase letter , it does not create new database row , essentially ignoring the change , leading to your data existing in the ACF tab in wordpress and being shown correctly , but being lost everytime you modify it for some post because the actual field name hasnt changed in the DB .

To Reproduce

  1. name the field exampleone
  2. put some value into it for a sample post
  3. change the field name to exampleOne
  4. change the value for sample post
  5. observe your data being empty on every load

Version Information:

  • WordPress Version [ Version 6.3.2]
  • ACF Version [e.g ACF Free Version 6.2.2]
@lgladdy
Copy link
Member

lgladdy commented Nov 4, 2023

ACF field names should be lowercase, never camelCase - as per the automatically generated names from labels.

Due to the way MySQL tables are usually case insensitive, modifying a field name after creation to change the case may result in this kind of unexpected behaviour, depending on your MySQL configuration. This is a MySQL limitation rather than ACF - although I will raise that we should warn not to use capitals in field names; however we need to find a way to do that without encouraging those who setup their sites original as capitalised to make them lowercase, or similar issues might occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants