diff --git a/src/MadeYourDay/Contao/CustomElements.php b/src/MadeYourDay/Contao/CustomElements.php index 495529c..29a702f 100644 --- a/src/MadeYourDay/Contao/CustomElements.php +++ b/src/MadeYourDay/Contao/CustomElements.php @@ -553,6 +553,38 @@ protected function createDcaItem($fieldPrefix, $fieldName, $fieldConfig, &$palet ); $paletteFields[] = $fieldPrefix . $fieldName . '_rsce_list_stop'; + } + else if ($fieldConfig['inputType'] === 'standardField') { + + if ($fieldPrefix !== 'rsce_field_') { + throw new \Exception('Input type "standardField" is not allowed inside lists.'); + } + + if (isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldName])) { + + if ( + isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldName]['eval']) + && is_array($GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldName]['eval']) + && isset($fieldConfig['eval']) + && is_array($fieldConfig['eval']) + ) { + $fieldConfig['eval'] = array_merge( + $GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldName]['eval'], + $fieldConfig['eval'] + ); + } + + unset($fieldConfig['inputType']); + + $GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldName] = array_merge( + $GLOBALS['TL_DCA'][$dc->table]['fields'][$fieldName], + $fieldConfig + ); + + $paletteFields[] = $fieldName; + + } + } else {