Commit 48f31928 authored by mmn's avatar mmn

Merge branch 'autocomplete-group' into 'nightly'

Autocomplete group

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

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

See merge request !68
parents 4904c2bc 3e830dad
......@@ -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));
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment