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

          Issue Links

            Activity

            Hide
            davosmith Davo Smith added a comment -

            Attaching patch

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

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

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

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

            Show
            poltawski Dan Poltawski added a comment - Linked to MDL-20137 as I think the problem might be related
            Hide
            poltawski 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
            poltawski 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
            davosmith 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
            davosmith 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
            davosmith Davo Smith added a comment -

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

            Show
            davosmith Davo Smith added a comment - If all OK, could it be put forward for integration review?
            Hide
            stronk7 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
            stronk7 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
            nebgor Aparup Banerjee added a comment -

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

            Show
            nebgor Aparup Banerjee added a comment - is this patch for 22 (to cherry-pick?) & master ? (according to affects version)
            Hide
            davosmith 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
            davosmith 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
            nebgor 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
            nebgor 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
            samhemelryk Sam Hemelryk added a comment -

            Thanks guys passing this test now

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks guys passing this test now
            Hide
            stronk7 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
            stronk7 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:
                  Fix Release Date:
                  14/May/12