From ba0b54e36722184c55536073233a34e911b08248 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Thu, 19 Jun 2014 11:47:17 -0500 Subject: [PATCH] oops: Fix crash on installation User::fromVars in class ticket was the root. Eventually, in DynamicForm::getDynamicFields(), isset($this->id) was used to detect unsaved, new forms that have not been committed to the database; however, the isset() method was not implemented for the ORM. --- include/class.orm.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/class.orm.php b/include/class.orm.php index 2dab46597..1fb285a67 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -49,6 +49,14 @@ class VerySimpleModel { } } + function __isset($field) { + return array_key_exists($field, $this->ht) + || isset(static::$meta['joins'][$field]); + } + function __unset($field) { + unset($this->ht[$field]); + } + function set($field, $value) { // Update of foreign-key by assignment to model instance if (isset(static::$meta['joins'][$field])) { -- GitLab