Commit 0432740f authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1708959: Fixing 'submitpages' vs 'submittableto' for group



In webservices / csv upload we deal with the variable 'submitpages' in
relation to if one can submit pages to group. But the group
create/update functions and db table expect 'submittableto'.

The csv upload function converts this as expected but the webservices
didn't.

Have made adjustemets to webservices to suit

behatnotneeded

Change-Id: Ia2a593705a85fec88debed63dd55277c8f1acc37
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 86b9b552
......@@ -210,6 +210,8 @@ class mahara_group_external extends external_api {
// create the group
$create['retainshortname'] = true;
// Internal function deals with 'submittableto' not 'submitpages'
$create['submittableto'] = !empty($create['submitpages']) ? 1 : 0;
$id = group_create($create);
$groupids[] = array('id'=> $id, 'name'=> $group['name']);
......@@ -494,6 +496,8 @@ class mahara_group_external extends external_api {
$newvalues->{$attr} = $group[$attr];
}
}
// Internal function deals with 'submittableto' not 'submitpages'
$newvalues->submittableto = !empty($newvalues->submitpages) ? 1 : 0;
group_update($newvalues);
// now update the group membership
......@@ -767,7 +771,7 @@ class mahara_group_external extends external_api {
'open' => ($dbgroup->jointype == 'open' ? 1 : 0),
'controlled' => ($dbgroup->jointype == 'controlled' ? 1 : 0),
'request' => $dbgroup->request,
'submitpages' => (isset($dbgroup->submitpages) ? $dbgroup->submitpages : 0),
'submitpages' => (isset($dbgroup->submittableto) ? $dbgroup->submittableto : 0),
'public' => $dbgroup->public,
'viewnotify' => $dbgroup->viewnotify,
'usersautoadded' => $dbgroup->usersautoadded,
......
Supports Markdown
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