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

Accesslib role caching get confused by a role with no capabilities

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4.3, 3.5, 3.6
    • Fix Version/s: 3.4.4, 3.5.1
    • Component/s: Roles / Access
    • Labels:
    • Testing Instructions:
      Hide

      I think that a full Moodle CI run is the best way to verify that this change at the heart of accesslib.php does not cause any regressions.

      New PHPunit tests have been added to verify that the caching is working as intended.

      I think no manual testing is needed.

      Show
      I think that a full Moodle CI run is the best way to verify that this change at the heart of accesslib.php does not cause any regressions. New PHPunit tests have been added to verify that the caching is working as intended. I think no manual testing is needed.
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull Master Branch:

      Description

      Steps to reproduce (easiest to be logged in in one browser as admin, and another as Student):

      1. Turn on performance info, so you can see a count of DB queries in the page footer.
      2. Log in as student, view a course page, and check the performance information is there. (Try to find a course with many activities.)
      3. Note the number of DB reads.
      4. Creat a new role, name 'Incapabable'
      5. Assigne that role to the student use, either at system level, or in the course.
      6. Logged in as student, reload the course page.
      7. Note the number of DB queries.

      Expected result: the number of queries does not change much.

      Actual result: the number of queries jumps by about the number of has_capability calls on the page.

      Verification:

      1. Edit the 'Incapable' role and add any one capability.
      2. As student, reload the course page.
      3. Verify that the number of DB queries goes down again.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Skylar Kelty Skylar Kelty
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              CiBoT CiBoT
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Jul/18