Commit c85b88c1 authored by Simey Lameze's avatar Simey Lameze
Browse files

MDL-74967 core: deprecate groupmember hack from USER object

parent ceb41588
......@@ -287,11 +287,6 @@ class course_modinfo {
private function get_groups_all() {
if (is_null($this->groups)) {
// NOTE: Performance could be improved here. The system caches user groups
// in $USER->groupmember[$courseid] => array of groupid=>groupid. Unfortunately this
// structure does not include grouping information. It probably could be changed to
// do so, without a significant performance hit on login, thus saving this one query
// each request.
$this->groups = groups_get_user_groups($this->course->id, $this->userid);
return $this->groups;
......@@ -4883,23 +4883,6 @@ function get_complete_user_data($field, $value, $mnethostid = null, $throwexcept
$sql = "SELECT, g.courseid
FROM {groups} g, {groups_members} gm
WHERE AND gm.userid=?";
// This is a special hack to speedup calendar display.
$user->groupmember = array();
if (!isguestuser($user)) {
if ($groups = $DB->get_records_sql($sql, array($user->id))) {
foreach ($groups as $group) {
if (!array_key_exists($group->courseid, $user->groupmember)) {
$user->groupmember[$group->courseid] = array();
$user->groupmember[$group->courseid][$group->id] = $group->id;
// Add cohort theme.
if (!empty($CFG->allowcohortthemes)) {
require_once($CFG->dirroot . '/cohort/lib.php');
......@@ -3,6 +3,8 @@ information provided here is intended especially for developers.
=== 4.1 ===
* The $USER->groupmember hack that fills the user object with the groups that the user belongs to has been removed.
Please use the Groups API function groups_get_user_groups() to fetch the cached list of groups the user is a member of.
* The method ensure_adhoc_task_qos() in lib/classes/task/manager.php has been deprecated, please use get_next_adhoc_task()
* New setting $CFG->enrolments_sync_interval controls the minimum time in seconds between re-synchronization of enrollment via enrol_check_plugins.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment