]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'autocomplete-group' into 'nightly'
authormmn <mmn@hethane.se>
Wed, 23 Dec 2015 21:04:18 +0000 (21:04 +0000)
committermmn <mmn@hethane.se>
Wed, 23 Dec 2015 21:04:18 +0000 (21:04 +0000)
Autocomplete group

Group autocompletion wasn't working for a couple of reasons:

1. $profile wasn't set (d8092207c0)
2. Profile::getUri() wasn't working for Groups, causing Profile::getAcctUri() to throw a ProfileNoAcctUriException (3e830dad374)

See merge request !68

classes/Profile_prefs.php

index 72a707cae86813149afad1297b1afd0c8a1e2bcb..bc7c400b890a2c8d3775b359256d0fd88c61a4e3 100644 (file)
@@ -85,17 +85,17 @@ 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();
         }
 
         $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;
     }