From 71119e498022035bb21fee77a0cd3043fd72a110 Mon Sep 17 00:00:00 2001 From: Chimo Date: Thu, 17 Dec 2015 14:55:39 +0000 Subject: [PATCH 1/2] Profile_prefs::getAll fix call to listFind 2nd argument needs to be an array --- classes/Profile_prefs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Profile_prefs.php b/classes/Profile_prefs.php index 72a707cae8..996fc1b6b6 100644 --- a/classes/Profile_prefs.php +++ b/classes/Profile_prefs.php @@ -85,7 +85,7 @@ class Profile_prefs extends Managed_DataObject static function getAll(Profile $profile) { try { - $prefs = self::listFind('profile_id', $profile->getID()); + $prefs = self::listFind('profile_id', array($profile->getID())); } catch (NoResultException $e) { return array(); } From 90945e548b4f0809981ebf8fdd6bb7ef5300cb7a Mon Sep 17 00:00:00 2001 From: Chimo Date: Thu, 17 Dec 2015 14:58:06 +0000 Subject: [PATCH 2/2] Profile_prefs::getAll fix prefs loop DataObject::fetch doesn't return an object. --- classes/Profile_prefs.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/Profile_prefs.php b/classes/Profile_prefs.php index 996fc1b6b6..bc7c400b89 100644 --- a/classes/Profile_prefs.php +++ b/classes/Profile_prefs.php @@ -91,11 +91,11 @@ class Profile_prefs extends Managed_DataObject } $list = array(); - while ($entry = $prefs->fetch()) { - if (!isset($list[$entry->namespace])) { - $list[$entry->namespace] = array(); + while ($prefs->fetch()) { + if (!isset($list[$prefs->namespace])) { + $list[$prefs->namespace] = array(); } - $list[$entry->namespace][$entry->topic] = $entry->data; + $list[$prefs->namespace][$prefs->topic] = $prefs->data; } return $list; }