Skip to content
Snippets Groups Projects
Commit 63b062d0 authored by Jared Hancock's avatar Jared Hancock
Browse files

Fix creation of user custom data on new tickets

parent 105a8350
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,8 @@ class UserModel extends VerySimpleModel {
class User extends UserModel {
var $_entries;
function __construct($ht) {
parent::__construct($ht);
// TODO: Make this automatic with select_related()
......@@ -89,6 +91,7 @@ class User extends UserModel {
foreach ($uf->getFields() as $f)
if (isset($data[$f->get('name')]))
$uf->setAnswer($f->get('name'), $data[$f->get('name')]);
$uf->setClientId($user->id);
$uf->save();
}
......@@ -123,9 +126,8 @@ class User extends UserModel {
function getDynamicData() {
if (!isset($this->_entries)) {
$this->_entries = DynamicFormEntry::forClient($this->id);
if (!$this->_entries[0]) {
$this->_entries = array();
$this->_entries = DynamicFormEntry::forClient($this->id)->all();
if (!$this->_entries) {
$g = UserForm::getInstance();
$g->setClientId($this->id);
$this->_entries[] = $g;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment