Moodle
  1. Moodle
  2. MDL-30608

Searching site settings causes blocks to disappear

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2, 2.3
    • Fix Version/s: 2.2.2
    • Component/s: Administration, Blocks
    • Labels:
    • Rank:
      33411

      Description

      If you log in as admin and search for something in the Settings block your search results are displayed but all the blocks have disappeared.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          This does not seem to affect the 2.1 branch.

          I couldn't see any recent change to the search.php file itself, so I assume it has something to do with the layout.

          Perhaps this is related to MDL-30340, which has not yet been backported.

          Show
          Michael de Raadt added a comment - This does not seem to affect the 2.1 branch. I couldn't see any recent change to the search.php file itself, so I assume it has something to do with the layout. Perhaps this is related to MDL-30340 , which has not yet been backported.
          Hide
          Michael de Raadt added a comment -

          Increasing the priority on this because it's really annoying me.

          Show
          Michael de Raadt added a comment - Increasing the priority on this because it's really annoying me.
          Hide
          Sam Hemelryk added a comment -

          I have to get going to the night IMMEDIATELY, however the solution for this problem is simple.
          Raj wanna turn it into a branch for me and peer-review?
          If not no probs I'll do it tomorrow when I am online.

          
          diff --git a/admin/search.php b/admin/search.php
          index 55d93c0..99ddf7e 100644
          --- a/admin/search.php
          +++ b/admin/search.php
          @@ -10,14 +10,14 @@ $query = trim(optional_param('query', '', PARAM_NOTAGS));  // Search string
           $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
           $PAGE->set_course($SITE);
           
          +admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
          +
           $adminroot = admin_get_root(); // need all settings here
           $adminroot->search = $query; // So we can reference it in search boxes later in this invocation
           $statusmsg = '';
           $errormsg  = '';
           $focus = '';
           
          -admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
          -
           // now we'll deal with the case that the admin has submitted the form with changed settings
           if ($data = data_submitted() and confirm_sesskey()) {
               if (admin_write_settings($data)) {
          
          

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - I have to get going to the night IMMEDIATELY, however the solution for this problem is simple. Raj wanna turn it into a branch for me and peer-review? If not no probs I'll do it tomorrow when I am online. diff --git a/admin/search.php b/admin/search.php index 55d93c0..99ddf7e 100644 --- a/admin/search.php +++ b/admin/search.php @@ -10,14 +10,14 @@ $query = trim(optional_param('query', '', PARAM_NOTAGS)); // Search string $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); $PAGE->set_course($SITE); +admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page + $adminroot = admin_get_root(); // need all settings here $adminroot->search = $query; // So we can reference it in search boxes later in this invocation $statusmsg = ''; $errormsg = ''; $focus = ''; -admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page - // now we'll deal with the case that the admin has submitted the form with changed settings if ($data = data_submitted() and confirm_sesskey()) { if (admin_write_settings($data)) { Cheers Sam
          Hide
          Sam Hemelryk added a comment -

          Ohh and remove `$PAGE->set_course($SITE);` that is totally unnecessary!

          Show
          Sam Hemelryk added a comment - Ohh and remove `$PAGE->set_course($SITE);` that is totally unnecessary!
          Hide
          Rajesh Taneja added a comment - - edited

          Thanks Sam, for spot-on patch.
          I have created branches and pushing it for peer-review.

          Show
          Rajesh Taneja added a comment - - edited Thanks Sam, for spot-on patch. I have created branches and pushing it for peer-review.
          Hide
          Michael de Raadt added a comment -

          Thanks for working on this, Sam.

          That changed worked for me.

          Show
          Michael de Raadt added a comment - Thanks for working on this, Sam. That changed worked for me.
          Hide
          Rajesh Taneja added a comment -

          Pushing it for integration review...

          Show
          Rajesh Taneja added a comment - Pushing it for integration review...
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          And test passed, I was really curious because I use the search facility a lot and had not noticed that at all. Now works properly.

          Show
          Eloy Lafuente (stronk7) added a comment - And test passed, I was really curious because I use the search facility a lot and had not noticed that at all. Now works properly.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This virus has been spread upstream, everybody will be infected soon. Congrats, you did it!

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - This virus has been spread upstream, everybody will be infected soon. Congrats, you did it! Closing, ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: