silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
720 stars 822 forks source link

Merge arrays recursively for FormField::setSchemaState and FormField::setSchemaData #11022

Open sabina-talipova opened 9 months ago

sabina-talipova commented 9 months ago

Description

Add deep merging of arrays like data and attributes into FormField::setSchemaData and FormField::setSchemaState.

Probably just use ArrayLib::array_merge_recursive()

See: https://github.com/silverstripe/silverstripe-framework/blob/cf78a9d785b9959a92dfb52c2a456bea80a4c567/src/Forms/FormField.php#L1429 See: https://github.com/silverstripe/silverstripe-framework/blob/cf78a9d785b9959a92dfb52c2a456bea80a4c567/src/Forms/FormField.php#L1505