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

A couple bugs in accesslib.php

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      While working on MDL-20045, I noticed a couple of bugs in the current accesslib.php in Moodle 2.0:

      • get_child_contexts sometimes returns a record set instead of an array, which is what the documentation states it is. This breaks get_role_context_caps, since it passes the return value of get_child_contexts to array_keys. In addition, the record set has already been iterated through, and cannot be rewound. (In Moodle 1.9, the record sets were copied to an array, and the array was returned).
      • fetch_context_capabilities for blocks and modules searches for records that have the component equal to "block/..." and "mod/..." respectively. However in Moodle 2.0, the format seems to have been changed to "block_..." and "mod_...". ("_" instead of "/".)

        Attachments

          Activity

            People

            • Assignee:
              andyjdavis Andrew Davis
              Reporter:
              hchathi Hubert Chathi
              Tester:
              Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

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