From 7c630cf36ba0ca78a76762ec424698156de18331 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Tue, 26 Aug 2014 16:47:22 -0500 Subject: [PATCH] forms: Selection of a choice field is not always required --- include/class.dynamic_forms.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 5452b7147..5a5f0baeb 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -1011,10 +1011,9 @@ class SelectionField extends FormField { parent::validateEntry($entry); if (!$this->errors()) { $config = $this->getConfiguration(); - if (!$entry || count($entry) == 0) - $this->_errors[] = __('Select a value from the list'); - elseif ($config['typeahead'] - && !in_array($this->getWidget()->getEnteredValue(), $entry)) + if ($config['typeahead'] + && ($entered = $this->getWidget()->getEnteredValue()) + && !in_array($entered, $entry)) $this->_errors[] = __('Select a value from the list'); } } -- GitLab