Actually return the group home URL

This commit is contained in:
Mikael Nordfeldth 2016-01-09 13:33:30 +01:00
parent d13483ca20
commit f143925931
2 changed files with 6 additions and 6 deletions

View File

@ -1426,7 +1426,7 @@ class Profile extends Managed_DataObject
if ($this->isGroup()) { if ($this->isGroup()) {
// FIXME: Get rid of this event, it fills no real purpose, data should be in Profile->profileurl (replaces User_group->mainpage) // FIXME: Get rid of this event, it fills no real purpose, data should be in Profile->profileurl (replaces User_group->mainpage)
if (Event::handle('StartUserGroupHomeUrl', array($this->getGroup(), &$url))) { if (Event::handle('StartUserGroupHomeUrl', array($this->getGroup(), &$url))) {
$url = $this->isLocal() $url = $this->getGroup()->isLocal()
? common_local_url('showgroup', array('nickname' => $this->getNickname())) ? common_local_url('showgroup', array('nickname' => $this->getNickname()))
: $this->profileurl; : $this->profileurl;
} }
@ -1434,11 +1434,11 @@ class Profile extends Managed_DataObject
} else { } else {
$url = $this->profileurl; $url = $this->profileurl;
} }
if (empty($this->profileurl) || if (empty($url) ||
!filter_var($this->profileurl, FILTER_VALIDATE_URL)) { !filter_var($url, FILTER_VALIDATE_URL)) {
throw new InvalidUrlException($this->profileurl); throw new InvalidUrlException($url);
} }
return $this->profileurl; return $url;
} }
public function getNickname() public function getNickname()

View File

@ -115,7 +115,7 @@ class User_group extends Managed_DataObject
function homeUrl() function homeUrl()
{ {
$this->getProfile()->getUrl(); return $this->getProfile()->getUrl();
} }
function getUri() function getUri()