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

Error on Shibboleth login when using user profile menu field

    XMLWordPrintable

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide

      1. Turn on Shibboleth authentication.
      2. Turn on Developer-level debugging.
      3. Hit the Shibboleth login page.

      You shouldn't get any notices.

      Show
      1. Turn on Shibboleth authentication. 2. Turn on Developer-level debugging. 3. Hit the Shibboleth login page. You shouldn't get any notices.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-27563-master

      Description

      After creating a user profile menu field, started to get the following error when on Shibboleth login:
      Coding problem: this page does not set $PAGE->context properly.
      line 341 of /lib/pagelib.php: call to debugging()
      line 599 of /lib/pagelib.php: call to moodle_page->magic_get_context()
      line 1236 of /lib/weblib.php: call to moodle_page->__get()
      line 23 of /user/profile/field/menu/field.class.php: call to format_string()
      line 496 of /user/profile/lib.php: call to profile_field_menu->profile_field_menu()
      line 517 of /user/profile/lib.php: call to profile_user_record()
      line 3820 of /lib/moodlelib.php: call to profile_load_custom_fields()
      line 3504 of /lib/moodlelib.php: call to get_complete_user_data()
      line 42 of /auth/shibboleth/index.php: call to authenticate_user_login()

      Adding $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); to the top of auth/shibboleth/index.php appears to fix the problem.

      This is similar to MDL-27192, but in a different area. The same problem likely appears in other areas as well.

      A comment on the line in format_string predicts problems, so, ideally, we could have a more general solution...

      1234 if (empty($options['context'])) {
      1235 // fallback to $PAGE->context this may be problematic in CLI and other non-standard pages
      1236 $options['context'] = $PAGE->context;

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cfulton Charles Fulton
              Reporter:
              colin Colin Campbell
              Peer reviewer:
              Dan Poltawski
              Integrator:
              Sam Hemelryk
              Tester:
              Rossiani Wijaya
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/12