mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-61435-master' of git://github.com/lameze/moodle
This commit is contained in:
commit
d282ecf683
1 changed files with 8 additions and 7 deletions
|
@ -1754,15 +1754,16 @@ class core_tag_tag {
|
||||||
list($contextsql, $contextsqlparams) = $DB->get_in_or_equal($contextids);
|
list($contextsql, $contextsqlparams) = $DB->get_in_or_equal($contextids);
|
||||||
$params = array_merge($params, $contextsqlparams);
|
$params = array_merge($params, $contextsqlparams);
|
||||||
|
|
||||||
$subsql = "SELECT tagid
|
$subsql = "SELECT DISTINCT t.id
|
||||||
FROM {tag_instance}
|
FROM {tag} t
|
||||||
|
JOIN {tag_instance} ti ON t.id = ti.tagid
|
||||||
WHERE component = ?
|
WHERE component = ?
|
||||||
AND itemtype = ?
|
AND itemtype = ?
|
||||||
AND contextid {$contextsql}
|
AND contextid {$contextsql}";
|
||||||
GROUP BY tagid";
|
|
||||||
$sql = "SELECT *
|
$sql = "SELECT tt.*
|
||||||
FROM {tag}
|
FROM ($subsql) tv
|
||||||
WHERE id IN ({$subsql})";
|
JOIN {tag} tt ON tt.id = tv.id";
|
||||||
|
|
||||||
return array_map(function($record) {
|
return array_map(function($record) {
|
||||||
return new core_tag_tag($record);
|
return new core_tag_tag($record);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue