MDL-21907 reverting latest change in groups api, we definitely can not make changes like this in stable and right before the release
This commit is contained in:
+3
-3
@@ -157,7 +157,7 @@ function groups_get_user_groups($courseid, $userid=0) {
|
||||
|
||||
$result = array();
|
||||
$allgroups = array();
|
||||
|
||||
|
||||
while ($group = rs_fetch_next_record($rs)) {
|
||||
$allgroups[$group->id] = $group->id;
|
||||
if (is_null($group->groupingid)) {
|
||||
@@ -346,7 +346,7 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
if ($groupmode == VISIBLEGROUPS or has_capability('moodle/site:accessallgroups', $context)) {
|
||||
$allowedgroups = groups_get_all_groups($course->id, 0);
|
||||
$allowedgroups = groups_get_all_groups($course->id, 0, $course->defaultgroupingid);
|
||||
// detect changes related to groups and fix active group
|
||||
if (!empty($SESSION->activegroup[$course->id][VISIBLEGROUPS][0])) {
|
||||
if (!array_key_exists($SESSION->activegroup[$course->id][VISIBLEGROUPS][0], $allowedgroups)) {
|
||||
@@ -362,7 +362,7 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
|
||||
}
|
||||
|
||||
} else {
|
||||
$allowedgroups = groups_get_all_groups($course->id, $USER->id);
|
||||
$allowedgroups = groups_get_all_groups($course->id, $USER->id, $course->defaultgroupingid);
|
||||
// detect changes related to groups and fix active group
|
||||
if (isset($SESSION->activegroup[$course->id][SEPARATEGROUPS][0])) {
|
||||
if ($SESSION->activegroup[$course->id][SEPARATEGROUPS][0] == 0) {
|
||||
|
||||
Reference in New Issue
Block a user