Skip to content

Commit 39d5bf0

Browse files
author
David Monllao
committed
Merge branch 'MDL-63234-master' of git://github.com/andrewnicols/moodle
2 parents 12f7678 + 1a5a0b9 commit 39d5bf0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

blocks/recent_activity/classes/task/cleanup.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ public function get_name() {
5050
* Remove old entries from table block_recent_activity
5151
*/
5252
public function execute() {
53-
global $DB;
53+
global $CFG, $DB;
54+
require_once("{$CFG->dirroot}/course/lib.php");
55+
5456
// Those entries will never be displayed as RECENT anyway.
55-
$DB->delete_records_select('block_recent_activity', 'timecreated < ?',
56-
array(time() - COURSE_MAX_RECENT_PERIOD));
57+
$DB->delete_records_select('block_recent_activity', 'timecreated < ?', [
58+
time() - COURSE_MAX_RECENT_PERIOD,
59+
]);
5760
}
5861
}

0 commit comments

Comments
 (0)