Commit 89e175f8 authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review
Browse files

Merge changes Ic8cd7493,Idfb4b2ec

* changes:
  Fix error when cancelling the edit group form (bug #924644)
  Fix error when creating publicly viewable groups (bug #917383)
parents 8a8358cf 2258e65f
......@@ -105,7 +105,8 @@ $form = array(
),
'submit' => array(
'type' => 'submitcancel',
'value' => array(get_string('savegroup', 'group'), get_string('cancel'))
'value' => array(get_string('savegroup', 'group'), get_string('cancel')),
'goto' => get_config('wwwroot') . 'group/mygroups.php',
),
),
);
......@@ -232,8 +233,10 @@ else {
$publicallowed = get_config('createpublicgroups') == 'all' || (get_config('createpublicgroups') == 'admins' && $USER->get('admin'));
if (!$id && !param_variable('editgroup_submit', null)) {
// If 'public=0' param is passed on first page load, hide the public checkbox.
if (!$id && !param_exists('pieform_editgroup')) {
// If a 'public=0' parameter is passed on the first page load, hide the
// public checkbox. The only purpose of this is to allow custom create
// group buttons/links which lead to a slightly simplified form.
$publicparam = param_integer('public', null);
}
......
......@@ -1006,6 +1006,10 @@ function _param_retrieve($name) {
return array($value, false);
}
function param_exists($name) {
return isset($_POST[$name]) || isset($_GET[$name]);
}
/**
* This function returns a GET or POST parameter with optional default. If the
* default isn't specified and the parameter hasn't been sent, a
......
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