diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 11318d4363a7a5f900b1daa5fbbb98c9db2d72ca..3a445717776c6f44ff6cab59ba717d0fe79876b4 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -1127,7 +1127,9 @@ class SelectionField extends FormField { if (!is_array($value)) { $choices = $this->getChoices(); if (isset($choices[$value])) - $value = $choices[$value]; + $value = array($value => $choices[$value]); + elseif ($id && isset($choices[$id])) + $value = array($id => $choices[$id]); } // Don't set the ID here as multiselect prevents using exactly one // ID value. Instead, stick with the JSON value only.