From ca00f225a3c9053c01c312007d11e6205461af72 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 8 Jun 2015 15:37:24 -0500 Subject: [PATCH] oops: Fix crash registering a user --- include/class.user.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/class.user.php b/include/class.user.php index 3ba2b54ae..ad3302a2c 100644 --- a/include/class.user.php +++ b/include/class.user.php @@ -1069,7 +1069,13 @@ class UserAccountModel extends VerySimpleModel { } function getUser() { - $this->user->set('account', $this); + // FIXME: The ORM will expect a ClientAccount instance as the + // User.account relationship is defined thusly; however, $this is an + // instance of UserAccount. Therefore we will (cast) to a + // ClientAccount instance first. This could be better rectified by + // collapsing UserAccount into ClientAccount. + $acct = new ClientAccount($this->ht); + $this->user->set('account', $acct); return $this->user; } -- GitLab