From 67eb4c1e906b9021735d8d23437c355f7d94449a Mon Sep 17 00:00:00 2001 From: raviks789 <33730024+raviks789@users.noreply.github.com> Date: Tue, 19 Apr 2022 15:33:09 +0200 Subject: [PATCH] Prevent inserting blank entries for extensible data list. --- library/Director/DataType/DataTypeDatalist.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Director/DataType/DataTypeDatalist.php b/library/Director/DataType/DataTypeDatalist.php index 5c5d72dc3..354c7c377 100644 --- a/library/Director/DataType/DataTypeDatalist.php +++ b/library/Director/DataType/DataTypeDatalist.php @@ -59,7 +59,9 @@ public function getFormElement($name, QuickForm $form) $db = $form->getDb(); foreach ($value as $entry) { - $this->createEntryIfNotExists($db, $listId, $entry); + if ($entry !== '') { + $this->createEntryIfNotExists($db, $listId, $entry); + } } }); }