From f40b444ef8fad68c7b85879ec24cee0e42e5e73a Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Wed, 13 Apr 2016 07:46:44 +0800 Subject: [PATCH] MDL-52707 tags: fix SQL query to work on all DBs --- tag/classes/tag.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tag/classes/tag.php b/tag/classes/tag.php index 27e66c54b2f..26ee6905147 100644 --- a/tag/classes/tag.php +++ b/tag/classes/tag.php @@ -1583,10 +1583,10 @@ class core_tag_tag { // Item is tagged with both main tag and the duplicate tag. // Remove instance pointing to the duplicate tag. $tag->delete_instance_as_record($record, false); - $sql = "UPDATE {tag_instance} ti SET ordering = ordering - 1 - WHERE ti.itemtype = :itemtype - AND ti.itemid = :itemid AND ti.component = :component AND ti.tiuserid = :tiuserid - AND ti.ordering > :ordering"; + $sql = "UPDATE {tag_instance} SET ordering = ordering - 1 + WHERE itemtype = :itemtype + AND itemid = :itemid AND component = :component AND tiuserid = :tiuserid + AND ordering > :ordering"; $DB->execute($sql, (array)$record); } else { // Item is tagged only with duplicate tag but not the main tag.