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

Non-admins can add admin bookmarks block

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8
    • Component/s: Blocks
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      A non-admin user on their My Moodle page finds the "Admin bookmarks" block listed in the drop-down menu of available blocks to add. It should only be shown for admin users.

      When a non-admin user selects to add this block the following debug info is printed:

      Error: Invalid context creation request for level "50", instance "3".

      • line 1675 of lib\accesslib.php: call to debugging()
      • line 1833 of lib\accesslib.php: call to create_context()
      • line 2980 of lib\accesslib.php: call to get_context_instance()
      • line 3867 of lib\accesslib.php: call to get_parent_contexts()
      • line 1688 of lib\accesslib.php: call to insert_context_rel()
      • line 1833 of lib\accesslib.php: call to create_context()
      • line 297 of blocks\moodleblock.class.php: call to get_context_instance()
      • line 319 of lib\blocklib.php: call to block_base->_add_edit_controls()
      • line 49 of my\index.php: call to blocks_print_group()

        Gliffy Diagrams

          Activity

          Hide
          delius Gustav W Delius added a comment -

          The same problem actually applies to several other blocks, like the "Network Servers" block for example.

          Show
          delius Gustav W Delius added a comment - The same problem actually applies to several other blocks, like the "Network Servers" block for example.
          Hide
          dougiamas Martin Dougiamas added a comment -

          Hi, Petr.

          Can you urgently look at this?

          We may need to return different applicable_formats() for some blocks depending on a capability check.

          Show
          dougiamas Martin Dougiamas added a comment - Hi, Petr. Can you urgently look at this? We may need to return different applicable_formats() for some blocks depending on a capability check.
          Hide
          dougiamas Martin Dougiamas added a comment -

          Fixed in CVS for admin_tree, admin, admin_bookmarks and mnet_hosts.

          Show
          dougiamas Martin Dougiamas added a comment - Fixed in CVS for admin_tree, admin, admin_bookmarks and mnet_hosts.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                31/Mar/07