From d8092207c0849b41f8f1c6bc6f6f08276895b9fe Mon Sep 17 00:00:00 2001 From: Chimo Date: Tue, 15 Dec 2015 21:48:18 -0500 Subject: [PATCH 1/2] Autocomplete: Fix $profile being null for groups --- plugins/Autocomplete/actions/autocomplete.php | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/Autocomplete/actions/autocomplete.php b/plugins/Autocomplete/actions/autocomplete.php index d5370fe0e1..29921a5564 100644 --- a/plugins/Autocomplete/actions/autocomplete.php +++ b/plugins/Autocomplete/actions/autocomplete.php @@ -153,6 +153,7 @@ class AutocompleteAction extends Action ); } foreach($this->groups as $group){ + $profile = $group->getProfile(); // sigh.... encapsulate this upstream! if ($group->mini_logo) { $avatarUrl = $group->mini_logo; From 3e830dad374c9ccceaaa24fc7b8f87c1357fc3d7 Mon Sep 17 00:00:00 2001 From: Chimo Date: Tue, 15 Dec 2015 21:49:42 -0500 Subject: [PATCH 2/2] Make Profile::getUri work with Groups and by extension Profile::getAcctUri --- classes/Profile.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/Profile.php b/classes/Profile.php index 78ef18484c..547ed485e8 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -1439,6 +1439,11 @@ class Profile extends Managed_DataObject $user = User::getKV('id', $this->id); if ($user instanceof User) { $uri = $user->getUri(); + } else { + $group = User_group::getKV('profile_id', $this->id); + if ($group instanceof User_group) { + $uri = $group->getUri(); + } } Event::handle('EndGetProfileUri', array($this, &$uri));