cms
cms copied to clipboard
[5.x] Merge config field defaults into field config
This pull request fixes #10106, where the Code Fieldtype wouldn't retain the selected mode even when the mode_selectable
config option looked like it was enabled (by default, it's set to true
).
This was happening since the Code::process()
method saves just the code value and not the mode/language when mode_selectable
is false
:
https://github.com/statamic/cms/blob/73c48a448d4be476f4cc7e70e55e0d7c24e4f1b8/src/Fieldtypes/Code.php#L152-L154
https://github.com/statamic/cms/blob/73c48a448d4be476f4cc7e70e55e0d7c24e4f1b8/src/Fieldtypes/Code.php#L194-L197
This PR fixes that by ensuring the default values for fieldtype config fields are included in the output of Fieldtype::config()
.
This PR also fixes an issue where default values for common fields (like "replicator preview") weren't being returned by the Blueprints toPublishArray
method, which caused replicator previews to not be displayed.
Fixes #10106. Fixes #10198.