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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.9.2
    • 2.9
    • Blocks
    • MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • MDL-50663-master
    • 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

    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.

      Attachments

        1. mypatch2
          1 kB
        2. secondpatch
          0.5 kB

        Issue Links

          Activity

            People

              skylarkelty Skylar Kelty
              skylarkelty Skylar Kelty
              Simey Lameze Simey Lameze
              Dan Poltawski Dan Poltawski
              John Okely John Okely
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.