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

Plugins with global settings can cause blocks to disappear from admin pages

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.2, 2.3
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Administration
    • Labels:
      None
    • Testing Instructions:
      Hide

      Install the 'course_menu' block (or other plugin that needs to call a function that initialises themes, such as $OUTPUT->pix_url, in its settings.php file)
      As site admin, visit course/index.php
      (Turn on editing if not already on)
      Click on a category
      Make sure the blocks are visible on the page

      Show
      Install the 'course_menu' block (or other plugin that needs to call a function that initialises themes, such as $OUTPUT->pix_url, in its settings.php file) As site admin, visit course/index.php (Turn on editing if not already on) Click on a category Make sure the blocks are visible on the page
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-31853_admin_externalpage_setup

      Description

      This was discovered whilst using the 'course_menu' block, but could apply to other plugins.

      When the function 'admin_externalpage_setup' is called, it initialises all the settings pages (including those for plugins) before calling $PAGE->set_pagelayout.

      If one of these settings pages causes the theme to be initialised (in the case of 'course_menu' it calls $OUTPUT->pix_url which does this) then the pagelayout is initialised to the default ('base') and the admin external page is displayed with this layout (which, by default, means it has no blocks displayed).

      I'll attach a patch which moves the 'pagelayout' settings before the 'admin_get_root' call, so that these are always set first.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/12