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();
|
$cur = common_current_user();
|
||||||
|
|
||||||
// Checked in prepare() above
|
// Checked in prepare() above
|
||||||
@ -215,7 +213,6 @@ class NewgroupAction extends Action
|
|||||||
'location' => $location,
|
'location' => $location,
|
||||||
'aliases' => $aliases,
|
'aliases' => $aliases,
|
||||||
'userid' => $cur->id,
|
'userid' => $cur->id,
|
||||||
'mainpage' => $mainpage,
|
|
||||||
'local' => true));
|
'local' => true));
|
||||||
|
|
||||||
common_redirect($group->homeUrl(), 303);
|
common_redirect($group->homeUrl(), 303);
|
||||||
|
@ -487,6 +487,7 @@ class User_group extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MAGICALLY put fields into current scope
|
// MAGICALLY put fields into current scope
|
||||||
|
// @fixme kill extract(); it makes debugging absurdly hard
|
||||||
|
|
||||||
extract($fields);
|
extract($fields);
|
||||||
|
|
||||||
@ -498,6 +499,9 @@ class User_group extends Memcached_DataObject
|
|||||||
// fill in later...
|
// fill in later...
|
||||||
$uri = null;
|
$uri = null;
|
||||||
}
|
}
|
||||||
|
if (empty($mainpage)) {
|
||||||
|
$mainpage = common_local_url('showgroup', array('nickname' => $nickname));
|
||||||
|
}
|
||||||
|
|
||||||
$group->nickname = $nickname;
|
$group->nickname = $nickname;
|
||||||
$group->fullname = $fullname;
|
$group->fullname = $fullname;
|
||||||
|
Loading…
Reference in New Issue
Block a user