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

Blank /my/ page when user doesn't have editing capability

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9.2
    • Component/s: Blocks
    • Labels:
    • Testing Instructions:
      Hide
      1. Install Moodle 2.9
      2. Edit /my/indexsys.php, add some blocks
      3. Set $CFG->forcedefaultmymoodle to true
      4. Try and view the /my/ page, verify your blocks are there
      5. Remove the moodle/my:manageblocks capability
      6. Login as non-admin
      7. Try and view the /my/ page, verify your blocks are there
      Show
      Install Moodle 2.9 Edit /my/indexsys.php, add some blocks Set $CFG->forcedefaultmymoodle to true Try and view the /my/ page, verify your blocks are there Remove the moodle/my:manageblocks capability Login as non-admin Try and view the /my/ page, verify your blocks are there
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50663-master

      Description

      When a user doesn't have the moodle/my:manageblocks capability, or when $CFG->forcedefaultmymoodle is set, they cannot see any items on their /my/ page.
      This was not an issue pre-2.9.

      The problem is that when you edit indexsys.php, it creates DB entries with 'showinsubcontexts' set to 0 and with a 'subpagepattern' of 2. This means the SQL to find page blocks for the current user in `function load_blocks` (blocklib.php) never matches them.

      The page is always set to your user's context if logged in. The SQL in load_blocks looks for things with your user's context or that shows up in subcontexts, and can't find anything.
      It also checks for a subpagepattern of NULL but because they're all '2', it filters everything out.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/Sep/15