Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Cannot save field data when changing field casing after initial creation #7

Open
emcarru opened this issue Nov 30, 2016 · 3 comments
Open

Comments

@emcarru
Copy link
Contributor

emcarru commented Nov 30, 2016

How to duplicate:

  1. Make a module with a text field with the name "Item".
  2. Add the module to a page, enter some dummy text to the "Item" field & hit save.
  3. Change the field name to "item".
  4. 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.
@emcarru emcarru added the bug label Nov 30, 2016
@dgrdl
Copy link
Contributor

dgrdl commented Jan 27, 2017

Dumb question that needs to be asked: Did you actually reload between steps 3 and 4?

@dgrdl
Copy link
Contributor

dgrdl commented Feb 21, 2017

@emcarru please test again if this is still happening.

@domtra domtra added the on hold label Jun 6, 2017
@dgrdl dgrdl removed the Core Team label Jun 13, 2017
@dgrdl
Copy link
Contributor

dgrdl commented Jun 26, 2017

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.

@dgrdl dgrdl added the rfc label Jun 26, 2017
@dgrdl dgrdl unassigned domtra and dgrdl Jul 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants