Commit 1002024c authored by Andrew Nicols's avatar Andrew Nicols
Browse files

Merge branch 'wip-MDL-50851-backupfix' of git://github.com/marinaglancy/moodle

parents 59a968dc 83acb499
......@@ -796,10 +796,11 @@ class core_tag_tag {
'contextid' => $record->taginstancecontextid, 'tiuserid' => $tiuserid);
$tag = new static($record);
$tag->delete_instance_as_record($taginstance, false);
$sql = "UPDATE {tag_instance} ti SET ordering = ordering - 1
WHERE ti.itemtype = :itemtype
AND ti.itemid = :itemid $componentsql $usersql
AND ti.ordering > :ordering";
$componentsql = $component ? " AND component = :component " : "";
$sql = "UPDATE {tag_instance} SET ordering = ordering - 1
WHERE itemtype = :itemtype
AND itemid = :itemid $componentsql $usersql
AND ordering > :ordering";
$params['ordering'] = $record->ordering;
$DB->execute($sql, $params);
}
......
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