From f143925931a562d7c0e30bbec7bd4fdb2ceb704a Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 9 Jan 2016 13:33:30 +0100 Subject: [PATCH] Actually return the group home URL --- classes/Profile.php | 10 +++++----- classes/User_group.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/Profile.php b/classes/Profile.php index 8e12dfc6ee..845e4d429d 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -1426,7 +1426,7 @@ class Profile extends Managed_DataObject if ($this->isGroup()) { // 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))) { - $url = $this->isLocal() + $url = $this->getGroup()->isLocal() ? common_local_url('showgroup', array('nickname' => $this->getNickname())) : $this->profileurl; } @@ -1434,11 +1434,11 @@ class Profile extends Managed_DataObject } else { $url = $this->profileurl; } - if (empty($this->profileurl) || - !filter_var($this->profileurl, FILTER_VALIDATE_URL)) { - throw new InvalidUrlException($this->profileurl); + if (empty($url) || + !filter_var($url, FILTER_VALIDATE_URL)) { + throw new InvalidUrlException($url); } - return $this->profileurl; + return $url; } public function getNickname() diff --git a/classes/User_group.php b/classes/User_group.php index 497e301dad..2484f3f265 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -115,7 +115,7 @@ class User_group extends Managed_DataObject function homeUrl() { - $this->getProfile()->getUrl(); + return $this->getProfile()->getUrl(); } function getUri()