Moodle
  1. Moodle
  2. MDL-31534

Maintenance mode require_login() shows debugging

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.1, 2.3
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Authentication
    • Labels:

      Description

      Coding problem: $PAGE->context was not set. You may have forgotten to call require_login() or $PAGE->set_context(). The page may not display correctly as a result
       
          line 345 of /lib/pagelib.php: call to debugging()
          line 617 of /lib/pagelib.php: call to moodle_page->magic_get_context()
          line 1214 of /lib/weblib.php: call to moodle_page->__get()
          line 920 of /lib/pagelib.php: call to format_string()
          line 2478 of /lib/weblib.php: call to moodle_page->set_title()
          line 2726 of /lib/moodlelib.php: call to print_maintenance_message()
          line 38 of /index.php: call to require_login()

      Replication steps:

      1. Enable maintenance mode,
      2. turn debugging on with display errors.
      3. login as student/user that cannot browse site with maint mode on.
      4. Error displays.

        Gliffy Diagrams

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that, Dan.

          Show
          Michael de Raadt added a comment - Thanks for reporting that, Dan.
          Hide
          Petr Skoda added a comment -

          Thanks a lot for the report.

          Show
          Petr Skoda added a comment - Thanks a lot for the report.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Uhm, sorry, but I've seen that, apart from moving the set_page() to top... you've taken rid of the redirect=0 thingy... uhm... and it sounds to me that we have uses of it here and there (from recent integrations).

          Perhaps those uses should be revisited before allowing this to land?

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Uhm, sorry, but I've seen that, apart from moving the set_page() to top... you've taken rid of the redirect=0 thingy... uhm... and it sounds to me that we have uses of it here and there (from recent integrations). Perhaps those uses should be revisited before allowing this to land? Ciao
          Hide
          Petr Skoda added a comment -

          arrgh, I missed the redirect=1 default, fixing

          Show
          Petr Skoda added a comment - arrgh, I missed the redirect=1 default, fixing
          Hide
          Petr Skoda added a comment -

          fixed and force pushed, sorry for the trouble - redirect in this case is not an action command to redirect, but quite the opposite - it alters the actions of the current page, it might have been better to call it "preventredirects" because it is different from other redirect commands such as those found in resource modules.

          big thanks!!!

          Show
          Petr Skoda added a comment - fixed and force pushed, sorry for the trouble - redirect in this case is not an action command to redirect, but quite the opposite - it alters the actions of the current page, it might have been better to call it "preventredirects" because it is different from other redirect commands such as those found in resource modules. big thanks!!!
          Hide
          Eloy Lafuente (stronk7) added a comment - - edited

          Yup, it surprised me a bit some weeks ago when I saw it in action to prevent redirects to "/my". I was expecting "something else" from a param named that way.

          Anyway... it looks ok now... so integrating, thanks for quick-amending!

          Show
          Eloy Lafuente (stronk7) added a comment - - edited Yup, it surprised me a bit some weeks ago when I saw it in action to prevent redirects to "/my". I was expecting "something else" from a param named that way. Anyway... it looks ok now... so integrating, thanks for quick-amending!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks! (21, 22 & master)

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (21, 22 & master)
          Hide
          Rajesh Taneja added a comment -

          Thanks Petr,

          No error message displayed when user (without site browse permission) try to login in Maintenance mode

          Show
          Rajesh Taneja added a comment - Thanks Petr, No error message displayed when user (without site browse permission) try to login in Maintenance mode
          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: