Skip to content

Commit

Permalink
fix(condition): display of tested question shows wrong item
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jan 24, 2023
1 parent cee504c commit 5d34da8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions inc/question.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1055,10 +1055,12 @@ public static function dropdownForForm($form, $crit, $name, $value = null, $opti
$options = $options + [
'display' => $options['display'] ?? true,
];
if (is_string($value)) {
$options['value'] = $value;
} else if (is_array($value)) {
$options['values'] = $value;
if ($value !== null) {
if (is_array($value)) {
$options['values'] = $value;
} else {
$options['value'] = $value;
}
}
$output = Dropdown::showFromArray($name, $items, $options);

Expand Down

0 comments on commit 5d34da8

Please sign in to comment.