From da7bec9f4ab28d576a7ce08ba6d2b68655fd576e Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Sat, 25 Jun 2016 09:37:11 -0500
Subject: [PATCH] orm: Fix warning for read-only permission

This fixes an issue where the `$ht` variable is not properly initialized by
the ORM. It is assumed to be a valid array in the constructor, and its items
are run through the ::set() method. Therefore, if an empty array is
received, the `$ht` variable will remain null, since nothing is ever set.

This also fixes a misspelled variable in the claim dialog if a ticket is
currently assigned to a team only.
---
 include/ajax.tickets.php | 2 +-
 include/class.orm.php    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php
index 74bbd13e5..5015363ec 100644
--- a/include/ajax.tickets.php
+++ b/include/ajax.tickets.php
@@ -502,7 +502,7 @@ class TicketsAjaxAPI extends AjaxController {
             if ($ticket->getStaffId() == $thisstaff->getId())
                 $assigned = __('you');
             else
-                $assigneed = $ticket->getAssigned();
+                $assigned = $ticket->getAssigned();
 
             $info['error'] = sprintf(__('%s is currently assigned to <b>%s</b>'),
                     __('This ticket'),
diff --git a/include/class.orm.php b/include/class.orm.php
index b784b6341..d1bbbc302 100644
--- a/include/class.orm.php
+++ b/include/class.orm.php
@@ -293,7 +293,7 @@ class VerySimpleModel {
         'pk' => false
     );
 
-    var $ht;
+    var $ht = array();
     var $dirty = array();
     var $__new__ = false;
     var $__deleted__ = false;
-- 
GitLab