diff --git a/include/class.forms.php b/include/class.forms.php index 58a8fe4031add2c2fb4ce811ed2c636502c43893..490ad8df539b2d80fac9ec89a5a57fc01af5824c 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -786,7 +786,9 @@ class ChoiceField extends FormField { } function toString($value) { - return (string) $this->getChoice($value); + $selection = $this->getChoice($value); + return is_array($selection) ? implode(', ', array_filter($selection)) + : (string) $selection; } function getChoice($value) { @@ -800,7 +802,7 @@ class ChoiceField extends FormField { elseif ($this->get('default')) $selection[] = $choices[$this->get('default')]; - return $selection ? implode(', ', array_filter($selection)) : ''; + return $selection; } function getChoices($verbose=false) {