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

sitepolicynotagreed popup appears when trying to start a user tour

    XMLWordPrintable

Details

    • MOODLE_311_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-72325-310-tourspolicy
    • MDL-72325-311-tourspolicy
    • MDL-72325-master-tourspolicy
    • Hide
      1. Log in as admin
      2. Go to Site administration > Users > Privacy and policies > Policy settings
      3. Define some URL (such as https://example.com) as the "Site policy URL" (sitepolicy)
      4. Go to Site administration > Appearance > User tours
      5. Create new tour
      6. In the "Apply to URL match" use /% so that it matches any URL
      7. In the "Show if target not found" select "Yes"
      8. Define a single step of the tour that shows some message in the middle of the page.
      9. Log out
      10. Log in as a student
        1. CONFIRM: Site policy agreement is shown
        2. CONFIRM: The user tour is not displayed
      11. Agree to the policy
        1. CONFIRM: The user tour is displayed
      Show
      Log in as admin Go to Site administration > Users > Privacy and policies > Policy settings Define some URL (such as https://example.com ) as the "Site policy URL" (sitepolicy) Go to Site administration > Appearance > User tours Create new tour In the "Apply to URL match" use /% so that it matches any URL In the "Show if target not found" select "Yes" Define a single step of the tour that shows some message in the middle of the page. Log out Log in as a student CONFIRM: Site policy agreement is shown CONFIRM: The user tour is not displayed Agree to the policy CONFIRM: The user tour is displayed

    Description

      If the user has not yet agreed to the site policy and there is a user tour to be started, an ugly error popup "sitepolicynotagreed" appears.

      This was originally noticed by jessica@moodle.com as a bug affecting Moodle Academy: users who log in via OAuth2, get this error box on the landing screen and then on every single screen of the site policy wizard.

      Steps to reproduce:

      1. Log in as admin
      2. Go to Site administration > Users > Privacy and policies > Policy settings
      3. Define some URL (such as https://example.com) as the "Site policy URL" (sitepolicy)
      4. Go to Site administration > Appearance > User tours
      5. Create new tour
      6. In the "Apply to URL match" use /% so that it matches any URL
      7. In the "Show if target not found" select "Yes"
      8. Define a single step of the tour that shows some message in the middle of the page.
      9. Log out
      10. Log in as a student

      Expected behaviour

      Site policy agreement is shown and only once the site policy is agreed, the custom user tour runs

      Actual buggy behaviour

      An error popup sitepolicynotagreed appears with call stack

      Error code: sitepolicynotagreed
      * line 2855 of /lib/moodlelib.php: moodle_exception thrown
      * line 515 of /lib/externallib.php: call to require_login()
      * line 62 of /admin/tool/usertours/classes/external/tour.php: call to external_api::validate_context()
      * line 261 of /lib/externallib.php: call to tool_usertours\external\tour::fetch_and_start_tour()
      * line 81 of /lib/ajax/service.php: call to external_api::call_external_function()
      

      Attachments

        Issue Links

          Activity

            People

              mudrd8mz David Mudrák (@mudrd8mz)
              mudrd8mz David Mudrák (@mudrd8mz)
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Andrew Lyons Andrew Lyons
              Angelia Dela Cruz Angelia Dela Cruz
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Sep/21

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 5 hours, 40 minutes
                  5h 40m