diff --git a/include/class.config.php b/include/class.config.php index 23772d05b8d48028e3ee55bd2da0793e90a4f58a..b0373f6e9d9679b2ec93e8b8179efbdf2b2167fc 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -1059,11 +1059,11 @@ class OsticketConfig extends Config { if($errors) return false; return $this->updateAll(array( - 'ticket_autoresponder'=>$vars['ticket_autoresponder'], - 'message_autoresponder'=>$vars['message_autoresponder'], - 'message_autoresponder_collabs'=>$vars['message_autoresponder_collabs'], - 'ticket_notice_active'=>$vars['ticket_notice_active'], - 'overlimit_notice_active'=>$vars['overlimit_notice_active'], + 'ticket_autoresponder'=>isset($vars['ticket_autoresponder']) ? 1 : 0, + 'message_autoresponder'=>isset($vars['message_autoresponder']) ? 1 : 0, + 'message_autoresponder_collabs'=>isset($vars['message_autoresponder_collabs']) ? 1 : 0, + 'ticket_notice_active'=>isset($vars['ticket_notice_active']) ? 1 : 0, + 'overlimit_notice_active'=>isset($vars['overlimit_notice_active']) ? 1 : 0, )); } diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php index 0be50264d8b4326a43c3a5fb20944a622adc3d8d..5c388bba877b29d057f09a92a676d92cf7d18926 100644 --- a/include/class.dynamic_forms.php +++ b/include/class.dynamic_forms.php @@ -43,7 +43,7 @@ class DynamicForm extends VerySimpleModel { var $_form; var $_fields; var $_has_data = false; - var $_dfields; + var $_dfields = array(); function getFields($cache=true) { if (!isset($this->_fields) || !$cache) { @@ -56,7 +56,7 @@ class DynamicForm extends VerySimpleModel { } function getDynamicFields() { - if (!isset($this->_dfields)) { + if (!isset($this->_dfields) && isset($this->id)) { $this->_dfields = DynamicFormField::objects() ->filter(array('form_id'=>$this->id)) ->all(); diff --git a/include/class.forms.php b/include/class.forms.php index 1f27486edecce19becd8812634c742554f40cf31..61e0ce0fea3d186fa02fb10ea8b9016920b5cf22 100644 --- a/include/class.forms.php +++ b/include/class.forms.php @@ -974,7 +974,7 @@ class TextboxWidget extends Widget { $config = $this->field->getConfiguration(); if (isset($config['size'])) $size = "size=\"{$config['size']}\""; - if (isset($config['length'])) + if (isset($config['length']) && $config['length']) $maxlength = "maxlength=\"{$config['length']}\""; if (isset($config['classes'])) $classes = 'class="'.$config['classes'].'"';