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

count_role_users gives unexpected results

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7.7, 2.8.5
    • 2.7.8, 2.8.6
    • Roles / Access
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • Hide

      Run the lib/tests/accesslib_test.php unit tests. They should all pass.

      If they are run without the last commit in the attached branches the new unit test for count_role_users will fail.

      This should be tested against all databases.

      Show
      Run the lib/tests/accesslib_test.php unit tests. They should all pass. If they are run without the last commit in the attached branches the new unit test for count_role_users will fail. This should be tested against all databases.

    Description

      The count_role_users function in lib/accesslib.php gives the wrong results if a user has the same role at multiple levels in a context path.

      For example a user is a coursecreator on a course and the category that the course is in, in this case they would be counted twice, rather than being recognised as the same user.

      Attachments

        Issue Links

          Activity

            People

              nmagill Neill Magill
              nmagill Neill Magill
              Andrew Lyons Andrew Lyons
              Adrian Greeve Adrian Greeve
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/May/15