Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-15712

groups_get_course_group returns incorect value

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Gradebook, Groups
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      When $SESSION was change from an array to an object in the development branch it partly broke the function groups_get_course_group in grouplib.php.

      In groups_get_course_group there is the fallowing check:

      if (!array_key_exists('activegroup', $SESSION))

      Since $SESSION is now an object it will allways return false and then runs:

      $SESSION->activegroup = array();

      This means that in the case when the param $update is not passed as true to groups_get_course_group the URI value 'group' is ignored and the wrong active group is returned.

      This effects the gradebook in that the group selector no longer works and for the grader report all groups are shown even when only one group is selected to be shown.

      I have attached a patch that fixes the problem for my local install, however i am not sure of it's correctness as i am not filmilure with the moodle_sessions class

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  skodak Petr Skoda
                  Reporter:
                  dservos Daniel Servos
                  Participants:
                  Component watchers:
                  Ankit Agarwal, David Monllaó, Shamim Rezaie, Simey Lameze
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    24/Nov/10