Cannot save field data when changing field casing after initial creation
How to duplicate:
- Make a module with a text field with the name "Item".
- Add the module to a page, enter some dummy text to the "Item" field & hit save.
- Change the field name to "item".
- Go back to the page and try to re-add your dummy text to the "item" field- after hitting "update" the page will refresh and the data will be gone again.
Dumb question that needs to be asked: Did you actually reload between steps 3 and 4?
@emcarru please test again if this is still happening.
Update: This is still the case, it also happens with ACF option pages. The reason for this is quite simple: it's the combination of WordPress / ACF functionality and a case-insensitive database. As I can't think of a good solution right now, the only "fix" for this would be to manually delete your values from the database.
Alternatively, we could start thinking about using (and enforcing) non camel case values (for example snake_case as ACF does by default in their UI, probably for the same reasons). @domtra what do you think about all this?
Edit: Another solution would be to have some kind of handler in between that converts from one way of spelling keys (camelCase) to a spelling that always works in the database (snake_case). Seems over the top, but maybe that's what needs to happen here.