Moodle
  1. Moodle
  2. MDL-31853

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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
    • Rank:
      38496

      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.

        Issue Links

          Activity

          Hide
          Davo Smith added a comment -

          Attaching patch

          Show
          Davo Smith added a comment - Attaching patch
          Hide
          Dan Poltawski added a comment -

          Ooh - I wonder if this is what is causing a problem on moodle.org Helen has spotted

          Show
          Dan Poltawski added a comment - Ooh - I wonder if this is what is causing a problem on moodle.org Helen has spotted
          Hide
          Dan Poltawski added a comment -

          Linked to MDL-20137 as I think the problem might be related

          Show
          Dan Poltawski added a comment - Linked to MDL-20137 as I think the problem might be related
          Hide
          Dan Poltawski added a comment -

          Makes sense to me, although i'm not too sure if it is the same as the linked issue.

          Are those testing instructions correct? [Would've thought it would be an admin page you need to visit]

          Show
          Dan Poltawski added a comment - Makes sense to me, although i'm not too sure if it is the same as the linked issue. Are those testing instructions correct? [Would've thought it would be an admin page you need to visit]
          Hide
          Davo Smith added a comment -

          Testing instructions fixed - you need to click on a 'category' not a 'course'; that then presents you with an external admin page.

          Show
          Davo Smith added a comment - Testing instructions fixed - you need to click on a 'category' not a 'course'; that then presents you with an external admin page.
          Hide
          Davo Smith added a comment -

          If all OK, could it be put forward for integration review?

          Show
          Davo Smith added a comment - If all OK, could it be put forward for integration review?
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Some hours ago...

          the main moodle.git repository has been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Some hours ago... the main moodle.git repository has been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Aparup Banerjee added a comment -

          is this patch for 22 (to cherry-pick?) & master ? (according to affects version)

          Show
          Aparup Banerjee added a comment - is this patch for 22 (to cherry-pick?) & master ? (according to affects version)
          Hide
          Davo Smith added a comment -

          I've tested and reproduced it with 2.2 and master. I haven't tested with 2.0 / 2.1, but I suspect it will be an issue there as well.

          Show
          Davo Smith added a comment - I've tested and reproduced it with 2.2 and master. I haven't tested with 2.0 / 2.1, but I suspect it will be an issue there as well.
          Hide
          Aparup Banerjee added a comment -

          ok i've picked this onto 21, 22 and master as the bug is general and affect all those stable branches , (also the linked issue affected 20!)

          integrated and ready for testing.

          Show
          Aparup Banerjee added a comment - ok i've picked this onto 21, 22 and master as the bug is general and affect all those stable branches , (also the linked issue affected 20!) integrated and ready for testing.
          Hide
          Sam Hemelryk added a comment -

          Thanks guys passing this test now

          Show
          Sam Hemelryk added a comment - Thanks guys passing this test now
          Hide
          Eloy Lafuente (stronk7) added a comment -

          FCT (fixed, closing, thanks). Ciao

          "I feel a very unusual sensation - if it is not indigestion, I think it must be gratitude!"
          ~ Benjamin Disraeli

          Show
          Eloy Lafuente (stronk7) added a comment - FCT (fixed, closing, thanks). Ciao "I feel a very unusual sensation - if it is not indigestion, I think it must be gratitude!" ~ Benjamin Disraeli

            People

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

              Dates

              • Created:
                Updated:
                Resolved: