From 7edad9ec5ee1b2175082e596ecaec1a659a73ee6 Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Tue, 23 Nov 2021 00:00:06 +0100 Subject: [PATCH] [FEATURE] Add option to add empty select option in tca utility --- Classes/Utility/TcaUtility.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Classes/Utility/TcaUtility.php b/Classes/Utility/TcaUtility.php index d6df46f..980fc87 100644 --- a/Classes/Utility/TcaUtility.php +++ b/Classes/Utility/TcaUtility.php @@ -50,9 +50,17 @@ class TcaUtility * @return void */ public static function configureSelectFromArray( - &$tca, $column, $element, $options, $extensionKey = null + &$tca, + $column, + $element, + $options, + $extensionKey = null, + $addEmpty = false ) { $items = []; + if ($addEmpty) { + $items[] = ['-', '']; + } foreach ($options as $option) { $translationKey = "option.$element.$column.$option"; $translation = self::getTranslation(