Commit 281076d5 authored by Brion Vibber's avatar Brion Vibber

Fix for PHP notice spew in group creation via API: set default 'mainpage' in...

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.
parent 4b29d0eb
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment