From 281076d5f68e07d67709a5e97740a4b625f4ad68 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 6 Jan 2011 13:22:08 -0800 Subject: [PATCH] Fix for PHP notice spew in group creation via API: set default 'mainpage' in User_group::register() rather than forcing all callers to do it manually. --- actions/newgroup.php | 3 --- classes/User_group.php | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/actions/newgroup.php b/actions/newgroup.php index 42d488e54e..fb7f6347d4 100644 --- a/actions/newgroup.php +++ b/actions/newgroup.php @@ -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); diff --git a/classes/User_group.php b/classes/User_group.php index 68f61cb7f4..d402ed4773 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -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; -- 2.39.5