Commit b7a1693e authored by jun's avatar jun
Browse files

Merge branch 'MDL-74967-master' of https://github.com/lameze/moodle

parents 9a6d3bb3 c85b88c1
...@@ -287,11 +287,6 @@ class course_modinfo { ...@@ -287,11 +287,6 @@ class course_modinfo {
*/ */
private function get_groups_all() { private function get_groups_all() {
if (is_null($this->groups)) { 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); $this->groups = groups_get_user_groups($this->course->id, $this->userid);
} }
return $this->groups; return $this->groups;
......
...@@ -4883,23 +4883,6 @@ function get_complete_user_data($field, $value, $mnethostid = null, $throwexcept ...@@ -4883,23 +4883,6 @@ function get_complete_user_data($field, $value, $mnethostid = null, $throwexcept
} }
} }
$sql = "SELECT g.id, g.courseid
FROM {groups} g, {groups_members} gm
WHERE gm.groupid=g.id 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. // Add cohort theme.
if (!empty($CFG->allowcohortthemes)) { if (!empty($CFG->allowcohortthemes)) {
require_once($CFG->dirroot . '/cohort/lib.php'); require_once($CFG->dirroot . '/cohort/lib.php');
......
...@@ -3,6 +3,8 @@ information provided here is intended especially for developers. ...@@ -3,6 +3,8 @@ information provided here is intended especially for developers.
=== 4.1 === === 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() * The method ensure_adhoc_task_qos() in lib/classes/task/manager.php has been deprecated, please use get_next_adhoc_task()
instead. instead.
* New setting $CFG->enrolments_sync_interval controls the minimum time in seconds between re-synchronization of enrollment via enrol_check_plugins. * 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