Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
f40b444e
Commit
f40b444e
authored
Apr 13, 2016
by
Marina Glancy
Browse files
MDL-52707 tags: fix SQL query to work on all DBs
parent
aca13ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
tag/classes/tag.php
View file @
f40b444e
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment