Commit a9550412 authored by Robert Lyon's avatar Robert Lyon

Bug 1760742: Error when changing a group from standard to course

When there are no blogposts made

behatnotneeded

Change-Id: I7a3b2bed818c66fd4edef188ed7ba475e54c3a4c
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 087cb93d)
parent 0653aa29
......@@ -694,9 +694,9 @@ function group_update($new, $create=false) {
// to the group artefacts are updated
if ($old->grouptype != $new->grouptype) {
if ($new->grouptype == 'course') {
$ids = get_records_select_array('artefact',
if ($ids = get_records_select_array('artefact',
'"group" = ' . $new->id . ' AND artefacttype IN (\'blog\', \'blogpost\')',
null, '', 'id');
null, '', 'id')) {
$access = ($old->editroles == 'all' || $old->editroles == 'notmember');
db_begin();
foreach ($ids as $i => $artefact) {
......@@ -710,6 +710,7 @@ function group_update($new, $create=false) {
}
db_commit();
}
}
else { //grouptype = standard
$query = 'DELETE FROM {artefact_access_role}
WHERE role = \'tutor\'
......
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