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

Calendar block on the enrolment page throws require_login_exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • 3.5, 3.6.9, 3.9.11, 3.11.7
    • Blocks, Calendar, Enrolments
    • MOODLE_311_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_39_STABLE
    • Hide

      Workaround

      Re-configure the calendar block so that it has "Display on page types" set to "Any course page". That will stop attempting to display the calendar block on the enrolment page.

      Show
      Workaround Re-configure the calendar block so that it has "Display on page types" set to "Any course page". That will stop attempting to display the calendar block on the enrolment page.
    • Hide
      1. Add the calendar block to a course
      2. Configure the block so that it appears on any page ("Display on page types: Any page")
      3. Log in as a user not enrolled to that course
      4. Make sure you don't get an error message
      Show
      Add the calendar block to a course Configure the block so that it appears on any page ("Display on page types: Any page") Log in as a user not enrolled to that course Make sure you don't get an error message

      Originally reported by sccanedo at https://moodle.org/mod/forum/discuss.php?d=372283

      Steps to reproduce

      1. Add the calendar block to a course
      2. Configure the block so that it appears on any page ("Display on page types: Any page")
      3. Log in as a user not enrolled to that course

      Expected behaviour: The "Enrolment options" page should display so that the user can enrol to the course.

      Actual behaviour: require_login_exception is thrown:

      requireloginerror: Course or activity not accessible.
      File: lib/moodlelib.php
      Line: 2869
       
      Stack trace:
       
      Not enrolled
      Error code: requireloginerror
      * line 2869 of /lib/moodlelib.php: require_login_exception thrown
      * line 480 of /lib/externallib.php: call to require_login()
      * line 988 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()
      

            Votes:
            20 Vote for this issue
            Watchers:
            30 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m

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