From 948af0eafc33e983b250a07ffe67a2e73f4a53c6 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Fri, 15 May 2015 16:25:56 -0500 Subject: [PATCH] oops: Fix mapping of abbreviation to list selection on API --- include/class.dynamic_forms.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index d062222b1..d418afda0 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -1660,7 +1660,13 @@ class SelectionField extends FormField { return array($i=>$choices[$i]); // Query the store by value or extra (abbrv.) - if (($list=$this->getList()) && ($i=$list->getItem($value))) + if (!($list=$this->getList())) + return null; + + if ($i = $list->getItem($value)) + return array($i->getId() => $i->getValue()); + + if ($i = $list->getItem($value, true)) return array($i->getId() => $i->getValue()); return null; -- GitLab