From 62798159a4355a30b0dda4f521e8f15b5f010d87 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Fri, 25 Oct 2013 15:31:10 +0000
Subject: [PATCH] Fix keeping selection value in a selection field

Previously, the value of the selection was lost in the request and, if the
form field was marked as required, then a ticket could never be submitted.
---
 include/class.dynamic_forms.php | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index 79a092cbb..e0a2f1e86 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -708,6 +708,8 @@ class DynamicListItem extends VerySimpleModel {
 }
 
 class SelectionField extends FormField {
+    static $widget = 'SelectionWidget';
+
     function getListId() {
         list(,$list_id) = explode('-', $this->get('type'));
         return $list_id;
@@ -719,10 +721,6 @@ class SelectionField extends FormField {
         return $this->_list;
     }
 
-    function getWidget() {
-        return new SelectionWidget($this);
-    }
-
     function parse($value) {
         return $this->to_php($value);
     }
-- 
GitLab