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

$PAGE->context not set for shibboleth login page

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.2, 2.7
    • Fix Version/s: 2.5.6, 2.6.3
    • Component/s: Authentication
    • Labels:
    • Testing Instructions:
      Hide
      1. Enable shibboleth authentication.
      2. Turn on developer-level debugging.
      3. Add a custom profile field of type "Dropdown menu".
      4. Login with shibboleth.

      You shouldn't get any notices.

      If the tester doesn't have a shibboleth installation handy, it can be 'faked' in apache as follows:

      1. Enable shibboleth authentication in moodle.
      2. In moodle shibboleth config, set Username to "eppn".
      3. Place an .htaccess file in auth/shibboleth containing: SetEnv eppn "test@example.com"
      4. Logout of the site
      5. Visit the URL auth/shibboleth/index.php

      This should log you in as user test@example.com. Again, verify that no messages were generated.

      Show
      Enable shibboleth authentication. Turn on developer-level debugging. Add a custom profile field of type "Dropdown menu". Login with shibboleth. You shouldn't get any notices. If the tester doesn't have a shibboleth installation handy, it can be 'faked' in apache as follows: Enable shibboleth authentication in moodle. In moodle shibboleth config, set Username to "eppn". Place an .htaccess file in auth/shibboleth containing: SetEnv eppn "test@example.com" Logout of the site Visit the URL auth/shibboleth/index.php This should log you in as user test@example.com. Again, verify that no messages were generated.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-45118-shibboleth-login-warning

      Description

      If a custom user profile menu field is defined, then Shibboleth login will generate a developer error during login:

      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 451 of /lib/pagelib.php: call to debugging()
      line 734 of /lib/pagelib.php: call to moodle_page->magic_get_context()
      line 1313 of /lib/weblib.php: call to moodle_page->__get()
      line 23 of /user/profile/field/menu/field.class.php: call to format_string()
      line 509 of /user/profile/lib.php: call to profile_field_menu->profile_field_menu()
      line 530 of /user/profile/lib.php: call to profile_user_record()
      line 4784 of /lib/moodlelib.php: call to profile_load_custom_fields()
      line 4337 of /lib/moodlelib.php: call to get_complete_user_data()
      line 48 of /auth/shibboleth/index.php: call to authenticate_user_login()

      This was partially fixed in MDL-27563 for auth/shibboleth/login.php. The issue in this ticket relates to auth/shibboleth/index.php.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/May/14