When dealing with nested entries in a Matrix, defaults on multi-select fields are not being correctly saved or stored when saving their parent entry. This leads to large errors on the authoring end and disables the ability to use defaults.
Steps to reproduce
Create a Matrix field with nested entry types
Add a multi-select field to the entry type, ie Radio, Dropdown and select a default value
In a page that contains that Matrix field, add entry type from dropdown. You can see that the defaults are correctly selected here. Don't interact with any of the fields and hit Create entry.
Hit Save on the parent entry and get error messages about validation error in nested entry. These fields have defaults set and previously showed those defaults selected, but after saving the parent entry you can see the defaults have been cleared and nothing is selected.
Expected behavior
The defaults of multi-select fields in nested entries should remain selected after creating a nested entry and saving the parent entry without having to define them manually.
Actual behavior
The defaults of multi-select fields in nested entries are cleared after saving parent entries. This throws an error and disables the actual usage of defaults for the author.
What happened?
Description
When dealing with nested entries in a Matrix, defaults on multi-select fields are not being correctly saved or stored when saving their parent entry. This leads to large errors on the authoring end and disables the ability to use defaults.
Steps to reproduce
Create a Matrix field with nested entry types
Add a multi-select field to the entry type, ie Radio, Dropdown and select a default value
In a page that contains that Matrix field, add entry type from dropdown. You can see that the defaults are correctly selected here. Don't interact with any of the fields and hit
Create entry
.Hit
Save
on the parent entry and get error messages about validation error in nested entry. These fields have defaults set and previously showed those defaults selected, but after saving the parent entry you can see the defaults have been cleared and nothing is selected.Expected behavior
The defaults of multi-select fields in nested entries should remain selected after creating a nested entry and saving the parent entry without having to define them manually.
Actual behavior
The defaults of multi-select fields in nested entries are cleared after saving parent entries. This throws an error and disables the actual usage of defaults for the author.
Craft CMS version
5.4.0.1
PHP version
8.2.23
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions