diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 9fbe52ad36f6efacceee5f38676a75820f2e13bb..b48ac67f56634bc5af6fd87971b9af9a6669fc97 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -179,12 +179,15 @@ class TicketForm extends DynamicForm { } static function getInstance() { - if (!isset(static::$instance)) { - $o = static::objects(); - static::$instance = $o[0]->instanciate(); - } + if (!isset(static::$instance)) + static::$instance = static::getNewInstance(); return static::$instance; } + + static function getNewInstance() { + $o = static::objects(); + return $o[0]->instanciate(); + } } // Add fields from the standard ticket form to the ticket filterable fields Filter::addSupportedMatches('Custom Fields', function() { @@ -698,7 +701,7 @@ class DynamicList extends VerySimpleModel { return $selections; } } -FormField::addFieldTypes('Custom Lists', array(DynamicList, 'getSelections')); +FormField::addFieldTypes('Custom Lists', array('DynamicList', 'getSelections')); /** * Represents a single item in a dynamic list diff --git a/include/class.ticket.php b/include/class.ticket.php index 692c6e53ee0315691871461b499020baa1d1636c..9f42e5889156d86452abce19534e51d07e9c932c 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1928,7 +1928,7 @@ class Ticket { } // Create and verify the dynamic form entry for the new ticket - $form = TicketForm::getInstance(); + $form = TicketForm::getNewInstance(); // If submitting via email, ensure we have a subject and such foreach ($form->getFields() as $field) { $fname = $field->get('name');