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

Warning due to missing parameter with require_login_exception()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9.1
    • Component/s: Roles / Access
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49906-master

      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

              Assignee:
              lameze Simey Lameze
              Reporter:
              lameze Simey Lameze
              Peer reviewer:
              Ankit Agarwal Ankit Agarwal
              Integrator:
              Dan Poltawski Dan Poltawski
              Tester:
              Dave Cooper Dave Cooper
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                6/Jul/15