mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 00:20:37 +01:00
Merge branch 'MDL-61435-master' of git://github.com/lameze/moodle
This commit is contained in:
commit
d282ecf683
@ -1754,15 +1754,16 @@ class core_tag_tag {
|
||||
list($contextsql, $contextsqlparams) = $DB->get_in_or_equal($contextids);
|
||||
$params = array_merge($params, $contextsqlparams);
|
||||
|
||||
$subsql = "SELECT tagid
|
||||
FROM {tag_instance}
|
||||
$subsql = "SELECT DISTINCT t.id
|
||||
FROM {tag} t
|
||||
JOIN {tag_instance} ti ON t.id = ti.tagid
|
||||
WHERE component = ?
|
||||
AND itemtype = ?
|
||||
AND contextid {$contextsql}
|
||||
GROUP BY tagid";
|
||||
$sql = "SELECT *
|
||||
FROM {tag}
|
||||
WHERE id IN ({$subsql})";
|
||||
AND contextid {$contextsql}";
|
||||
|
||||
$sql = "SELECT tt.*
|
||||
FROM ($subsql) tv
|
||||
JOIN {tag} tt ON tt.id = tv.id";
|
||||
|
||||
return array_map(function($record) {
|
||||
return new core_tag_tag($record);
|
||||
|
Loading…
x
Reference in New Issue
Block a user