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

Warning due to missing parameter with require_login_exception()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.9
    • 2.9.1
    • Roles / Access
    • MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • MDL-49906-master
    • Hide
      1. Log in as guest.
      2. Visit user/preferences.php
      3. Visit message/ajax.php
      4. Make sure you don't get this warning:

        Output buffer: <br /> <b>Warning</b>: Missing argument 1 for require_login_exception::__construct(), called in /home/moodle/moodles/stable_master/moodle/user/preferences.php on line 30 and defined in <b>/home/moodle/moodles/stable_master/moodle/lib/setuplib.php</b> on line <b>162</b><br /> <br /> <b>Notice</b>: Undefined variable: debuginfo in <b>/home/moodle/moodles/stable_master/moodle/lib/setuplib.php</b> on line <b>163</b><br />
        

      5. Make sure it throws an exception: Guest are not allowed here.
      Show
      Log in as guest. Visit user/preferences.php Visit message/ajax.php Make sure you don't get this warning: Output buffer: <br /> <b>Warning</b>: Missing argument 1 for require_login_exception::__construct(), called in /home/moodle/moodles/stable_master/moodle/user/preferences.php on line 30 and defined in <b>/home/moodle/moodles/stable_master/moodle/lib/setuplib.php</b> on line <b>162</b><br /> <br /> <b>Notice</b>: Undefined variable: debuginfo in <b>/home/moodle/moodles/stable_master/moodle/lib/setuplib.php</b> on line <b>163</b><br /> Make sure it throws an exception: Guest are not allowed here.

    Description

      The method require_login_exception has wrong parameter definition, it declare the $debuginfo parameter as required, however is calls the constructor method, which can be null. This can lead to warning messages on few files that doens't set that parameter.

      Attachments

        Issue Links

          Activity

            People

              lameze Simey Lameze
              lameze Simey Lameze
              Ankit Agarwal Ankit Agarwal
              Dan Poltawski Dan Poltawski
              Dave Cooper Dave Cooper
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                6/Jul/15