statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
4.09k stars 534 forks source link

[5.x] Fix issue when preprocessing dictionary config #11133

Closed duncanmcclean closed 3 days ago

duncanmcclean commented 4 days ago

This pull request fixes an issue with the DictionaryFields fieldtype, responsible for the configuration of Dictionary fields.

When a dictionary doesn't have any config fields, it'll be saved as dictionary: artists.

When a dictionary does have config fields, it'll be saved as an array, like:

dictionary:
  type: artists
  category: rock

However, if a dictionary field was configured before any config fields were added, it would fail to be preprocessed correctly, due to just the dictionary select itself being processed, causing issues with some fieldtypes.

Fixes #11124.