MDL-40649 libraries: deprecated get_recent_enrolments()

This commit is contained in:
Mark Nelson
2013-07-19 18:17:31 +08:00
parent 4e829d48d1
commit 02ca2cada5
3 changed files with 9 additions and 6 deletions
@@ -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();
}
/**
+2 -4
View File
@@ -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 > ?
+1
View File
@@ -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()