forked from GNUsocial/gnu-social
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.
This commit is contained in:
parent
4b29d0ebb6
commit
281076d5f6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user