Skip to content
Snippets Groups Projects
Commit a81bc370 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #1425 from greezybacon/issue/dropdown-value-upgrade


forms: Fix interpretation of custom list data

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 86802cc6 eacf8a65
No related branches found
No related tags found
No related merge requests found
...@@ -1127,7 +1127,9 @@ class SelectionField extends FormField { ...@@ -1127,7 +1127,9 @@ class SelectionField extends FormField {
if (!is_array($value)) { if (!is_array($value)) {
$choices = $this->getChoices(); $choices = $this->getChoices();
if (isset($choices[$value])) 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 // Don't set the ID here as multiselect prevents using exactly one
// ID value. Instead, stick with the JSON value only. // ID value. Instead, stick with the JSON value only.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment