]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix for PHP notice spew in group creation via API: set default 'mainpage' in User_gro...
authorBrion Vibber <brion@pobox.com>
Thu, 6 Jan 2011 21:22:08 +0000 (13:22 -0800)
committerBrion Vibber <brion@pobox.com>
Thu, 6 Jan 2011 21:22:44 +0000 (13:22 -0800)
actions/newgroup.php
classes/User_group.php

index 42d488e54ebfef3a09bfd7b3ce15a96a01cf2807..fb7f6347d4c35504a004d1004fa8d87e42c8f77f 100644 (file)
@@ -200,8 +200,6 @@ class NewgroupAction extends Action
             }
         }
 
-        $mainpage = common_local_url('showgroup', array('nickname' => $nickname));
-
         $cur = common_current_user();
 
         // Checked in prepare() above
@@ -215,7 +213,6 @@ class NewgroupAction extends Action
                                             'location' => $location,
                                             'aliases'  => $aliases,
                                             'userid'   => $cur->id,
-                                            'mainpage' => $mainpage,
                                             'local'    => true));
 
         common_redirect($group->homeUrl(), 303);
index 68f61cb7f48a104b43aae7b84fcf5ba4503d7ca3..d402ed47733e3b631bca94c153bac8a28ed1dbbf 100644 (file)
@@ -487,6 +487,7 @@ class User_group extends Memcached_DataObject
         }
 
         // MAGICALLY put fields into current scope
+        // @fixme kill extract(); it makes debugging absurdly hard
 
         extract($fields);
 
@@ -498,6 +499,9 @@ class User_group extends Memcached_DataObject
             // fill in later...
             $uri = null;
         }
+        if (empty($mainpage)) {
+            $mainpage = common_local_url('showgroup', array('nickname' => $nickname));
+        }
 
         $group->nickname    = $nickname;
         $group->fullname    = $fullname;