Open Baumi-Dev opened 6 days ago
Can you provide a screencast or screenshot of what you are seeing and also the underlying data please?
Hi Ryan,
Thanks for getting back to me so quickly.
Please find screen recording and screenshot attached.
Cheers,
Alex
Here's a screencast as well...
https://github.com/statamic/eloquent-driver/assets/138436068/eeae327b-3fde-4d80-a626-9df3e050f90b
Thanks - just for clarity it's blueprint related rather than form related.
The underlying database engine reorders the JSON for the field type on save, so we would need to work around that and do something similar to how we handle sections: https://github.com/statamic/eloquent-driver/blob/8172d109b20f19ba9bb71e98210b07c977511a61/src/Fields/BlueprintRepository.php#L201
Gotcha! Sorry for the confusion, appreciate your help
I'll loop round to it when I can, in the mean time if you are able to make the keys numeric it should maintain your ordering. I'll also happily review a PR if its something you'd be prepared to have a go at yourself.
Sounds good, thanks! Might have a crack at it this weekend if you haven't already gotten to it before me. Cheers mate
Great, if you get to it before me I would suggest you extend the DataReferenceUpdater in core to recurse over the fields, as it will save quite a bit of logic creation. I appreciate your use case is form blueprints, but the solution will need to be able to handle selects inside replications (inside replicators....).
Bug description
When using eloquent driver, the form input options are stored as JSON data, which doesn't allow for specific ordering. Options should be stored in an array to allow for specific ordering
How to reproduce
Ordering options in flat files works fine, but when using eloquent driver, options are stored in a JSON object, causing the options to be stored in ascending order. Reordering options in the control panel doesn't work, as the options are always stored in ascending order
Logs
No response
Environment
Additional details
No response