cms
cms copied to clipboard
Field handles have no `snake_case` validation
Bug description
Field handles have no validation ensuring snake_case, which causes edge case JS errors when using field conditions (due to our omitter trying to access a JS key when a space characters exists in a field handle).
We probably should have some basic snake_case validation on field handles... https://github.com/statamic/cms/blob/7948e9934e7f39326451a230ba089d9120502828/src/Http/Controllers/CP/Fields/FieldsController.php#L92-L98
Maybe this is a breaking change for people and should be introduced in 3.4 or 4.0? Field handles with spaces would've only worked in places by fluke in the first place though (ie. {{ my field }}).
Environment
Statamic: 3.3.25
Just a note that {{ my field }} will not work in Antlers Runtime, and will generate [ANTLR_006]: Unexpected stack condition, but will in Regex mode.
Yeah we're just saying if it worked anywhere, it was by accident. Definitely shouldn't be allowed. 👍