From 35188879e03fa256bef7ba1967ad8b9e81831bfa Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 8 Nov 2023 15:43:07 +1300 Subject: [PATCH] FIX Add extraEmptyValues to TreedropdownField --- src/Forms/TreeDropdownField.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Forms/TreeDropdownField.php b/src/Forms/TreeDropdownField.php index e61e5411dd4..77c8cbb1890 100644 --- a/src/Forms/TreeDropdownField.php +++ b/src/Forms/TreeDropdownField.php @@ -984,4 +984,16 @@ public function setShowSelectedPath($showSelectedPath) $this->showSelectedPath = $showSelectedPath; return $this; } + + /** + * @return array + */ + public function getSchemaValidation() + { + $validationList = parent::getSchemaValidation(); + if (array_key_exists('required', $validationList)) { + $validationList['required'] = ['extraEmptyValues' => ['0']]; + } + return $validationList; + } }