Skip to content

Commit

Permalink
Merge branch 'wip-MDL-50851-backupfix' of git://github.com/marinaglan…
Browse files Browse the repository at this point in the history
…cy/moodle
  • Loading branch information
andrewnicols committed Jan 14, 2016
2 parents 59a968d + 83acb49 commit 1002024
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tag/classes/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,11 @@ public static function remove_item_tag($component, $itemtype, $itemid, $tagname,
'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);
}
Expand Down

0 comments on commit 1002024

Please sign in to comment.