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

IDPs cause error when a menu custom field is in use

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.6, 3.2.3, 3.3
    • Fix Version/s: 3.2.4, 3.3.1
    • Component/s: User management
    • Labels:
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-58916-master
    • Testing Instructions:
      Hide
      1. Go to Site administration > Users > Accounts > User profile field
      2. Add a menu profile field
      3. Setup and enable the oauth2 authentication plugin with at least one working oauth2 provider (for 3.2 install auth_googleoauth2 from plugins DB).
      4. Login as any user on your site. Link an oauth2 login to this user (preferences -> linked logins).
      5. Logout
      6. Login using the login page, clicking on the Oauth provider
      7. Ensure no error is displayed
      Show
      Go to Site administration > Users > Accounts > User profile field Add a menu profile field Setup and enable the oauth2 authentication plugin with at least one working oauth2 provider (for 3.2 install auth_googleoauth2 from plugins DB). Login as any user on your site. Link an oauth2 login to this user (preferences -> linked logins). Logout Login using the login page, clicking on the Oauth provider Ensure no error is displayed

      Description

      Because there is no page context the format string fails as it cannot determine the context. We can just use the site context

      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 493 of /lib/pagelib.php: call to debugging()
      line 820 of /lib/pagelib.php: call to moodle_page->magic_get_context()
      line 1435 of /lib/weblib.php: call to moodle_page->__get()
      line 62 of /user/profile/field/menu/field.class.php: call to format_string()
      line 622 of /user/profile/lib.php: call to profile_field_menu->__construct()
      line 678 of /user/profile/lib.php: call to profile_user_record()
      line 4712 of /lib/moodlelib.php: call to profile_load_custom_fields()
      line 400 of /auth/oauth2/classes/auth.php: call to get_complete_user_data()
      line 45 of /auth/oauth2/login.php: call to auth_oauth2\auth->complete_login()
      This page did not call $PAGE->set_url(...). Using https://john-mac.per.in.moodle.com:4335/integration_master/auth/oauth2/login.php?wantsurl=https%3A%2F%2Fjohn-mac.per.in.moodle.com%3A4335%2Fintegration_master%2F&sesskey=cvGd22EVM6&id=2&oauth2code=Mf6b72b6d-c210-db78-8e81-04ab64edfe9c
      line 600 of /lib/pagelib.php: call to debugging()
      line 820 of /lib/pagelib.php: call to moodle_page->magic_get_url()
      line 565 of /admin/tool/usertours/classes/manager.php: call to moodle_page->__get()
      line 505 of /admin/tool/usertours/classes/helper.php: call to tool_usertours\manager::get_current_tour()
      line 75 of /admin/tool/usertours/lib.php: call to tool_usertours\helper::bootstrap()
      line 1180 of /lib/outputrenderers.php: call to tool_usertours_before_footer()
      line 1035 of /lib/outputrenderers.php: call to core_renderer->footer()
      line ? of unknownfile: call to core_renderer->redirect_message()
      line 1849 of /lib/setuplib.php: call to call_user_func_array()
      line 2830 of /lib/weblib.php: call to bootstrap_renderer->__call()
      line 2830 of /lib/weblib.php: call to bootstrap_renderer->redirect_message()
      line 524 of /auth/oauth2/classes/auth.php: call to redirect()
      line 45 of /auth/oauth2/login.php: call to auth_oauth2\auth->complete_login()
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              johno John Okely
              Reporter:
              johno John Okely
              Peer reviewer:
              Ankit Agarwal Ankit Agarwal
              Integrator:
              Dan Poltawski Dan Poltawski
              Tester:
              Mark Nelson Mark Nelson
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Jul/17