Skip to content
Snippets Groups Projects
Commit 59ec7afc authored by JediKev's avatar JediKev
Browse files

issue: ChoiceField Template Variable

This addresses an issue on the forums where osTicket does not add the proper
values to any custom choices field template variable. This adds an `asVar()`
function to `class ChoiceField` so we can return the proper values for the
template variables.
parent 7bd08848
No related branches found
No related tags found
No related merge requests found
...@@ -1621,6 +1621,11 @@ class ChoiceField extends FormField { ...@@ -1621,6 +1621,11 @@ class ChoiceField extends FormField {
return (string) $value; return (string) $value;
} }
function asVar($value, $id=false) {
$value = $this->to_php($value);
return $this->toString($this->getChoice($value));
}
function whatChanged($before, $after) { function whatChanged($before, $after) {
$B = (array) $before; $B = (array) $before;
$A = (array) $after; $A = (array) $after;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment