Bug description
Saving checkbox or radio button fields on a form blueprint changes their format from:
options:
'Norway': 'Norway'
'Japan': 'Japan'
'Kenya': 'Kenya'
to
options:
-
key: Norway
value: Norway
-
key: Japan
value: Japan
-
key: Kenya
value: Kenya
This changes the way the data is returned to the frontend, giving back an array with the key and value defined within for the value rather than directly, as seen below:

This results in the fields not rendering properly:

How to reproduce
Create a checkbox or radio button within a form save, I triggered this breaking again by setting instructions on the field, but I don't think that was the exact cause, rather just it triggered the blueprint to re-save that field triggering the update.
Then attempt to render the field by looping over the data:
{{ foreach:options as="option|label" }}
<label class="text-[#66665D] font-montserrat font-medium text-xs inline-flex tracking-wide mr-5">
<input
class="form-checkbox text-[#F38B00] focus:ring-[#BCB9AF] flex-none"
type="checkbox"
name="{{ handle }}[]"
value="{{ option }}"
{{ if js_driver }}{{ js_attributes }}{{ /if }}
{{ if value|in_array:option }}checked{{ /if }}
{{ if validate|contains:required }}required{{ /if }}
>
<span class="flex-1 min-w-0 {{ inline ? 'ml-2' : 'ml-5' }}">{{ label !== null ? label : option }}</span>
</label>
{{ unless inline }}
<br>
{{ /unless }}
{{ /foreach:options }}
Please not the above slightly varies from the template defaults, but the important part is that the option and label in {{ foreach:options as="option|label" }} have their data formats changed.
Logs
No response
Environment
EnvironmentApplication Name: PelorusLaravel Version: 10.48.20PHP Version: 8.3.9Composer Version: 2.7.7Environment: localDebug Mode: ENABLEDURL: pelorus-travel.testMaintenance Mode: OFFCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: NOT CACHEDDriversBroadcasting: logCache: redisDatabase: mysqlLogs: stack / singleMail: logQueue: redisSession: redisStatamicAddons: 9Sites: 10 (Travel (GB), Travel (US), Aviation (GB), and 7 more)Stache Watcher: DisabledStatic Caching: DisabledVersion: 5.21.0 PROStatamic Addonsaryehraber/statamic-captcha: 1.12.1doefom/currency-fieldtype: 1.4.0gerttimmerman/statamic-zapier: 1.6jacksleight/statamic-bard-texstyle: 3.2.3ndx/statamic-bard-color-picker: 2.0.0ryanmitchell/statamic-translation-manager: 2.0.0statamic/eloquent-driver: 4.12.3thoughtco/statamic-cache-tracker: 0.5.1withcandour/aardvark-seo: 5.0.0Statamic Eloquent DriverAsset Containers: eloquentAssets: eloquentBlueprints: fileCollection Trees: fileCollections: fileEntries: fileForms: fileGlobal Sets: fileGlobal Variables: fileNavigation Trees: fileNavigations: fileRevisions: fileSites: fileTaxonomies: fileTerms: fileTokens: file
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Bug description
Saving checkbox or radio button fields on a form blueprint changes their format from:
to
This changes the way the data is returned to the frontend, giving back an array with the key and value defined within for the value rather than directly, as seen below:
This results in the fields not rendering properly:

How to reproduce
Create a checkbox or radio button within a form save, I triggered this breaking again by setting instructions on the field, but I don't think that was the exact cause, rather just it triggered the blueprint to re-save that field triggering the update.
Then attempt to render the field by looping over the data:
Please not the above slightly varies from the template defaults, but the important part is that the option and label in
{{ foreach:options as="option|label" }}have their data formats changed.Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response