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

Calendar block on frontpage throws exceptions "policy not agreed"


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.4.2
    • Calendar, Web Services

      1. Make sure $CFG->sitepolicyhandler is set to core
      2. Set something in $CFG->sitepolicyguest
      3. Add a calendar block on the frontpage (if not present)
      4. Logout, login as a guest
      5. View the frontpage
      6. You will see the AJAX exception:

        Error code: sitepolicynotagreed
        * line 2715 of /lib/moodlelib.php: moodle_exception thrown
        * line 480 of /lib/externallib.php: call to require_login()
        * line 981 of /calendar/externallib.php: call to external_api::validate_context()
        * line 228 of /lib/externallib.php: call to core_calendar_external::get_calendar_monthly_view()
        * line 59 of /lib/ajax/service.php: call to external_api::call_external_function()

      This happens because guests are not required to agree to the policies when viewing frontpage, they are only required to agree to the policies when they try to view the course with guest access.

      It is possible that the problem is actually inside external_api::validate_context() - it always calls require_login() and never require_course_login() , however, frontpage and frontpage activities do not call require_login(), some of them call require_course_login() instead.

            Unassigned Unassigned
            marina Marina Glancy
            3 Vote for this issue
            6 Start watching this issue


                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.