From ea962096af2be5c1e67f6dec95b557dfa6e8fbc4 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Tue, 1 Apr 2014 15:22:10 -0500
Subject: [PATCH] orm: Fix magic lookup of one-to-one relations

---
 include/class.orm.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/class.orm.php b/include/class.orm.php
index 63ce1e085..2dab46597 100644
--- a/include/class.orm.php
+++ b/include/class.orm.php
@@ -43,7 +43,8 @@ class VerySimpleModel {
             // TODO: Support instrumented lists and such
             $j = static::$meta['joins'][$field];
             $class = $j['fkey'][0];
-            $v = $this->ht[$field] = $class::lookup($this->ht[$j['local']]);
+            $v = $this->ht[$field] = $class::lookup(
+                array($j['fkey'][1] => $this->ht[$j['local']]));
             return $v;
         }
     }
-- 
GitLab