Merge branch 'MDL-83991_master' of https://github.com/panchalrohit/moodle

This commit is contained in:
Huong Nguyen
2025-09-19 08:56:48 +07:00
+7 -8
View File
@@ -1763,16 +1763,15 @@ class core_tag_tag {
list($contextsql, $contextsqlparams) = $DB->get_in_or_equal($contextids);
$params = array_merge($params, $contextsqlparams);
$subsql = "SELECT DISTINCT t.id
FROM {tag} t
JOIN {tag_instance} ti ON t.id = ti.tagid
WHERE component = ?
AND itemtype = ?
AND contextid {$contextsql}";
$subsql = "SELECT DISTINCT ti.tagid
FROM {tag_instance} ti
WHERE ti.component = ?
AND ti.itemtype = ?
AND ti.contextid {$contextsql}";
$sql = "SELECT tt.*
FROM ($subsql) tv
JOIN {tag} tt ON tt.id = tv.id";
FROM ($subsql) tv
JOIN {tag} tt ON tt.id = tv.tagid";
return array_map(function($record) {
return new core_tag_tag($record);