diff --git a/blocks/recent_activity/block_recent_activity.php b/blocks/recent_activity/block_recent_activity.php index b62eefb7851..c58c3596854 100644 --- a/blocks/recent_activity/block_recent_activity.php +++ b/blocks/recent_activity/block_recent_activity.php @@ -100,13 +100,17 @@ class block_recent_activity extends block_base { } /** - * Returns all recent enrollments + * Returns all recent enrolments. + * + * This function previously used get_recent_enrolments located in lib/deprecatedlib.php which would + * return an empty array which was identified in MDL-36993. The use of this function outside the + * deprecated lib was removed in MDL-40649. * * @todo MDL-36993 this function always return empty array * @return array array of entries from {user} table */ protected function get_recent_enrolments() { - return get_recent_enrolments($this->page->course->id, $this->get_timestart()); + return array(); } /** diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 0e27828bb9f..ff33108259a 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -455,9 +455,6 @@ function is_course_participant($userid, $courseid) { * * used to print recent activity * - * @todo MDL-36993 this function is still used in block_recent_activity, deprecate properly - * @global object - * @uses CONTEXT_COURSE * @param int $courseid The course in question. * @param int $timestart The date to check forward of * @return object|false {@link $USER} records or false if error. @@ -465,8 +462,9 @@ function is_course_participant($userid, $courseid) { function get_recent_enrolments($courseid, $timestart) { global $DB; - $context = context_course::instance($courseid); + debugging('get_recent_enrolments() is deprecated as it returned inaccurate results.', DEBUG_DEVELOPER); + $context = context_course::instance($courseid); $sql = "SELECT u.id, u.firstname, u.lastname, MAX(l.time) FROM {user} u, {role_assignments} ra, {log} l WHERE l.time > ? diff --git a/lib/upgrade.txt b/lib/upgrade.txt index 437a22cfacc..53c67a9a5a9 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -42,6 +42,7 @@ Accesslib: * load_temp_role() -> (no replacement) * remove_temp_roles() -> (no replacement) * get_related_contexts_string() -> $context->get_parent_context_ids(true) + * get_recent_enrolments() -> (no replacement) Enrollment: * get_course_participants() -> get_enrolled_users()