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

Exception when assigning roles for category-level block

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test 1

      1. Log in as admin
      2. Create a new role that can be assigned to block contexts
      3. Go to the front page and, turn editing on
      4. Navigate to a category (course/index.php?category=ID)
      5. Add a block to the category page
      6. Back on the category page, click the gear in the new block and choose Assign roles in NAME OF BLOCK
      7. Confirm that you do not get a fatal error
      8. Confirm that you can assign a role in that context

      Test 2

      1. Check the Behat results on CI, this should not have caused any regression
      Show
      Test 1 Log in as admin Create a new role that can be assigned to block contexts Go to the front page and, turn editing on Navigate to a category (course/index.php?category=ID) Add a block to the category page Back on the category page, click the gear in the new block and choose Assign roles in NAME OF BLOCK Confirm that you do not get a fatal error Confirm that you can assign a role in that context Test 2 Check the Behat results on CI, this should not have caused any regression
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-46640-master
    • Sprint:
      BACKEND Sprint 18

      Description

      See testing instructions for reproduction steps.
      original description:
      -------------------

      I am trying to configure a number of blocks in a category so that they will appear in all pages under that category, however none of these blocks appear.

      If you then try to assign permissions to any of the blocks I get a Coding error detected.

      'Default exception handler: Coding error detected, it must be fixed by a programmer: PHP catchable fatal error Debug: Argument 2 passed to has_any_capability() must be an instance of context, boolean given, called in [dir root]/course/lib.php on line 1424 and defined\nError code: codingerror\n* line 393 of /lib/setuplib. php: coding_exception thrown\n* line 514 of /lib/accesslib.php:'

      I am also trying this with a fresh XAMPP 2.7.1 installation package and see the same errors.

      All of this is done while logged on as the admin user, the procedure I am using is thus;

      Turn editing on;
      Go to Site administration;
      Select Manage Courses and categories
      Select category
      Add a block
      HTML or calendar or any type of block
      Configure the block
      Where this block appears and On this page
      Select Display on Category: category name and any pages within it
      change the default region and weight if required
      Save changes
      Go to any of the courses beneath the category and view.

      I would now expect to see the blocks appearing on all of the course pages under this category in the region and position selected however the block or blocks added do not display.

      This is working on our current live 2.3 system, however we are trying to upgrade to 2.7

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Jan/15