Moodle
  1. Moodle
  2. MDL-32485

Course content inaccessible when groupmembersonly is enabled, but no grouping is set

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.2.1, 2.3.3, 2.4
    • Fix Version/s: STABLE backlog
    • Component/s: Groups
    • Labels:
    • Testing Instructions:
      Hide
      1. Go to Site administration > Development > Experimental > Experimental settings and click "Enable group members only"
      2. Go to course and upload course content. In the "Common module settings" section, click "Show advanced" and click "Available for group members only", but select "None" for the grouping.
      3. Go to course settings and enable guest access
      4. Visit course as guest user
        1. EXPECTED: You can see the uploaded course content
        2. ACTUAL: You do not see the uploaded course content

      The regular testing for groupings and groupmembersonly should be performed as well to ensure no regressions.

      Show
      Go to Site administration > Development > Experimental > Experimental settings and click "Enable group members only" Go to course and upload course content. In the "Common module settings" section, click "Show advanced" and click "Available for group members only", but select "None" for the grouping. Go to course settings and enable guest access Visit course as guest user EXPECTED: You can see the uploaded course content ACTUAL: You do not see the uploaded course content The regular testing for groupings and groupmembersonly should be performed as well to ensure no regressions.
    • Workaround:
      Hide

      Manually uncheck groupmembersonly setting or run following sql command:

      UPDATE mdl_course_modules 
      SET groupmembersonly = 0
      WHERE groupingid = 0 AND groupmembersonly = 1
      
      Show
      Manually uncheck groupmembersonly setting or run following sql command: UPDATE mdl_course_modules SET groupmembersonly = 0 WHERE groupingid = 0 AND groupmembersonly = 1
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull 2.4 Branch:
    • Pull Master Branch:
    • Rank:
      39376

      Description

      Hello all,

      when enabling the enablegroupmembersonly - flag in Experiemental settings the course content is completely disappeared for role participant.

      I found that there must be going wrong in update_user_visible()

      The debugger jumps into

      else if (!empty($CFG->enablegroupmembersonly) and !empty($this->groupmembersonly)
                      and !has_capability('moodle/site:accessallgroups', $modcontext, $userid)) {
                  $groups = $this->modinfo->get_groups($this->groupingid);
      .....
      

      Then group is empty... so that uservisible is set to "false"

      In the corresponding course there is NO group setting done.
      That makes no sense.
      Hope somebody can help...

        Activity

        Stefan L created issue -
        Stefan L made changes -
        Field Original Value New Value
        Summary Course content complete disabled when enablegroupmembersonly is set Course content completey disabled when enablegroupmembersonly is set
        Priority Minor [ 4 ] Blocker [ 1 ]
        Stefan L made changes -
        Description Hello all,
        when enabling the enablegroupmembersonly - flag in Experiemental settings the course content is completely disappeared.
        In the corresponding course there is NO group setting done.
        That makes no sense.
        Hope somebody can help...
        Hello all,
        when enabling the enablegroupmembersonly - flag in Experiemental settings the course content is completely disappeared for role participant.

        In the corresponding course there is NO group setting done.
        That makes no sense.
        Hope somebody can help...
        Stefan L made changes -
        Description Hello all,
        when enabling the enablegroupmembersonly - flag in Experiemental settings the course content is completely disappeared for role participant.

        In the corresponding course there is NO group setting done.
        That makes no sense.
        Hope somebody can help...
        Hello all,
        when enabling the enablegroupmembersonly - flag in Experiemental settings the course content is completely disappeared for role participant.
        I found that there must be going wrong in update_user_visible()
        The debugger jumps into
        else if (!empty($CFG->enablegroupmembersonly) and !empty($this->groupmembersonly)
                        and !has_capability('moodle/site:accessallgroups', $modcontext, $userid)) {
                    $groups = $this->modinfo->get_groups($this->groupingid);
        .....

        Then group is empty... so that uservisible is set to "false"

        In the corresponding course there is NO group setting done.
        That makes no sense.
        Hope somebody can help...
        Michael de Raadt made changes -
        Summary Course content completey disabled when enablegroupmembersonly is set Course content completey disabled when enablegroupmembersonly is set after 1.9 => 2.2 upgrade
        Fix Version/s STABLE backlog [ 10463 ]
        Priority Blocker [ 1 ] Critical [ 2 ]
        Description Hello all,
        when enabling the enablegroupmembersonly - flag in Experiemental settings the course content is completely disappeared for role participant.
        I found that there must be going wrong in update_user_visible()
        The debugger jumps into
        else if (!empty($CFG->enablegroupmembersonly) and !empty($this->groupmembersonly)
                        and !has_capability('moodle/site:accessallgroups', $modcontext, $userid)) {
                    $groups = $this->modinfo->get_groups($this->groupingid);
        .....

        Then group is empty... so that uservisible is set to "false"

        In the corresponding course there is NO group setting done.
        That makes no sense.
        Hope somebody can help...
        Hello all,

        when enabling the enablegroupmembersonly - flag in Experiemental settings the course content is completely disappeared for role participant.

        I found that there must be going wrong in update_user_visible()

        The debugger jumps into

        {code}
        else if (!empty($CFG->enablegroupmembersonly) and !empty($this->groupmembersonly)
                        and !has_capability('moodle/site:accessallgroups', $modcontext, $userid)) {
                    $groups = $this->modinfo->get_groups($this->groupingid);
        .....
        {code}

        Then group is empty... so that uservisible is set to "false"

        In the corresponding course there is NO group setting done.
        That makes no sense.
        Hope somebody can help...
        Labels triaged
        Component/s Installation [ 10069 ]
        Rex Lorenzo made changes -
        Assignee moodle.com [ moodle.com ] Rex Lorenzo [ rex ]
        Rex Lorenzo made changes -
        Summary Course content completey disabled when enablegroupmembersonly is set after 1.9 => 2.2 upgrade Course content inaccessible when groupmembersonly is enabled, but no grouping is set
        Assignee Rex Lorenzo [ rex ] moodle.com [ moodle.com ]
        Rex Lorenzo made changes -
        Affects Version/s 2.4 [ 12255 ]
        Affects Version/s 2.3.3 [ 12373 ]
        Rex Lorenzo made changes -
        Pull Master Diff URL https://github.com/rlorenzo/moodle/compare/master...MDL-32485_25
        Pull Master Branch MDL-32485_25
        Pull 2.3 Diff URL https://github.com/rlorenzo/moodle/compare/MOODLE_23_STABLE...MDL-32485_23
        Pull 2.2 Diff URL https://github.com/rlorenzo/moodle/compare/MOODLE_22_STABLE...MDL-32485_22
        Pull 2.2 Branch MDL-32485_22
        Pull 2.4 Diff URL https://github.com/rlorenzo/moodle/compare/MOODLE_24_STABLE...MDL-32485_24
        Pull 2.4 Branch MDL-32485_24
        Component/s Groups [ 10163 ]
        Component/s Course [ 10057 ]
        Component/s Installation [ 10069 ]
        Pull 2.3 Branch MDL-32485_23
        Rex Lorenzo made changes -
        Testing Instructions # Go to Site administration > Development > Experimental > Experimental settings and click "Enable group members only"
        # Go to course and upload course content. In the "Common module settings" section, click "Show advanced" and click "Available for group members only", but select "None" for the grouping.
        # Go to course settings and enable guest access
        # Visit course as guest user
        ## EXPECTED: You can see the uploaded course content
        ## ACTUAL: You do not see the uploaded course content

        The regular testing for groupings and groupmembersonly should be performed as well to ensure no regressions.
        Workaround Manually uncheck groupmembersonly setting or run following sql command:

        {code}
        UPDATE mdl_course_modules
        SET groupmembersonly = 0
        WHERE groupingid = 0 AND groupmembersonly = 1
        {code}
        Labels triaged patch triaged

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: