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

Calendar block on the enrolment page throws require_login_exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.5
    • Fix Version/s: None
    • Component/s: Blocks, Calendar, Enrolments
    • Labels:
    • Testing Instructions:
      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
    • Workaround:
      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.
    • Affected Branches:
      MOODLE_35_STABLE

      Description

      Originally reported by Sophia Canedo 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()
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                7 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated: