Skip to content

Commit 5d34da8

Browse files
committed
fix(condition): display of tested question shows wrong item
1 parent cee504c commit 5d34da8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

inc/question.class.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -1055,10 +1055,12 @@ public static function dropdownForForm($form, $crit, $name, $value = null, $opti
10551055
$options = $options + [
10561056
'display' => $options['display'] ?? true,
10571057
];
1058-
if (is_string($value)) {
1059-
$options['value'] = $value;
1060-
} else if (is_array($value)) {
1061-
$options['values'] = $value;
1058+
if ($value !== null) {
1059+
if (is_array($value)) {
1060+
$options['values'] = $value;
1061+
} else {
1062+
$options['value'] = $value;
1063+
}
10621064
}
10631065
$output = Dropdown::showFromArray($name, $items, $options);
10641066

0 commit comments

Comments
 (0)