Closed jdd2405 closed 3 years ago
Since this bug is planned to fix in version 3 I suggest to add to the documentation that camelCase in structure field names in Blueprints are stored in lowercase attribute names when values are added from the backend.
Furthermore I found out that displaying values from camelCase attribute names in the backend is not possible unless they are written in lowercase.
not working ageMin, ageMax, startTime, endTime are not displayed as rows.
entry:
- jsname
- region
- website
- firstname
- lastname
- email
- tel
- ageMin
- ageMax
- startTime
- endTime
working
entry:
- jsname
- region
- website
- firstname
- lastname
- email
- tel
- agemin
- agemax
- starttime
- endtime
In my project I built a frontent form, where visitors can add a new entry. Those entries should be editable from the backend.
My Blueprint looks like this
My form in the frontend uses camelCase as well to store values. To display the values in a Google Map i fetch the values by ther attribute name in camelCase.
But as soon I change a Sturcture Entry in the backend which came in by the form in the frontend, old values are untouched but new values are added with attribute names in lowercase. Changes made this way do not affect the frontend output.
Example before change (values from frontend form)
Example after change (values from backend form)
The reason is in panel/app/src/panel/structure.php where the function array_change_key_case is used a few times.
I don't like to change all my attribute names to lowercase or snake_case since I find this uggly and means a huge effort to change all those code segments where i retreive or store these values.