From 4ed6c8e940646297131ae3818708617b7285933c Mon Sep 17 00:00:00 2001 From: "Barbesange, Jason" Date: Tue, 21 Nov 2023 14:20:47 +0100 Subject: [PATCH] test itemtype in getDropdownValue for group --- src/Dropdown.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Dropdown.php b/src/Dropdown.php index 166b5e77175..ccd28d0435b 100644 --- a/src/Dropdown.php +++ b/src/Dropdown.php @@ -3115,14 +3115,24 @@ public static function getDropdownValue($post, $json = true) } $title = sprintf(__('%1$s - %2$s'), $title, $addcomment); } - $datastoadd[] = [ - 'id' => $ID, - 'text' => $outputval, - 'level' => (int)$level, - 'title' => $title, - 'selection_text' => $selection_text, - 'is_notify' => $data['is_notify'] - ]; + if ($item->getType() == 'Group') { + $datastoadd[] = [ + 'id' => $ID, + 'text' => $outputval, + 'level' => (int)$level, + 'title' => $title, + 'selection_text' => $selection_text, + 'is_notify' => $data['is_notify'] + ]; + } else { + $datastoadd[] = [ + 'id' => $ID, + 'text' => $outputval, + 'level' => (int)$level, + 'title' => $title, + 'selection_text' => $selection_text + ]; + } $count++; } $firstitem = false;