]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Actually return the group home URL
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 9 Jan 2016 12:33:30 +0000 (13:33 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 9 Jan 2016 12:33:30 +0000 (13:33 +0100)
classes/Profile.php
classes/User_group.php

index 8e12dfc6ee5cbad32427996db1e0dc37fc6186d6..845e4d429d948e1bff6e51191f1dfa8e6fd375e9 100644 (file)
@@ -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()
index 497e301dade37c33b8de48f00978c692ae825ec9..2484f3f265252d8c375684b983cd5bac22bb1175 100644 (file)
@@ -115,7 +115,7 @@ class User_group extends Managed_DataObject
 
     function homeUrl()
     {
-        $this->getProfile()->getUrl();
+        return $this->getProfile()->getUrl();
     }
 
     function getUri()