Merge branch 'wip-MDL-56635-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Andrew Nicols 2018-04-04 11:27:11 +08:00
commit 6ab10c3d77

View File

@ -184,7 +184,7 @@ class tag_cron_task extends scheduled_task {
$sql = "SELECT DISTINCT component, itemtype
FROM {tag_instance}
WHERE itemtype <> 'user' or component <> 'core'";
$tagareas = $DB->get_records_sql($sql);
$tagareas = $DB->get_recordset_sql($sql);
foreach ($tagareas as $tagarea) {
$sql = 'SELECT ti.id
FROM {tag_instance} ti
@ -196,6 +196,7 @@ class tag_cron_task extends scheduled_task {
$tagarray[] = $tagid->id;
}
}
$tagareas->close();
// Get instances for each of the ids to be deleted.
if (count($tagarray) > 0) {