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

Fatal errors when trying to create an action calendar event outside of the module

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3
    • 3.3
    • Calendar
    • MOODLE_33_STABLE
    • MOODLE_33_STABLE
    • wip-MDL-58867-master
    • Hide

      Pick only the second commit from branch https://github.com/moodle/moodle/compare/master...marinaglancy:wip-MDL-58867-test
      This creates a "Middle of the course" calendar event for the courses in "Weeks" format.

      1. As a teacher create or edit course in the 'Weeks' format so it is a current course (has started but not yet finished). Create/edit event will trigger creating of the calendar event
      2. As a student enrolled in this course make sure you can see "Middle of the course" in the calendar
      3. Go to the dashboard, you won't see this event but at least there will be no fatal errors or weird popups and you will be able to see all other events

      Pick the third commit from the same branch

      1. As a student go to your Dashboard, you should be able to see the "Middle of the course"
        The link "Go learn!" is only displayed if you are in the first half of the course and the event is not actionable if you are in the second half.
      Show
      Pick only the second commit from branch https://github.com/moodle/moodle/compare/master...marinaglancy:wip-MDL-58867-test This creates a "Middle of the course" calendar event for the courses in "Weeks" format. As a teacher create or edit course in the 'Weeks' format so it is a current course (has started but not yet finished). Create/edit event will trigger creating of the calendar event As a student enrolled in this course make sure you can see "Middle of the course" in the calendar Go to the dashboard, you won't see this event but at least there will be no fatal errors or weird popups and you will be able to see all other events Pick the third commit from the same branch As a student go to your Dashboard, you should be able to see the "Middle of the course" The link "Go learn!" is only displayed if you are in the first half of the course and the event is not actionable if you are in the second half.

      Displaying action calendar events for dashboard is currently only supported for the modules.

      However there is already some code that checks if modulename is empty or not and performs different logic if it is empty.

      If plugin defines an action event on the course level and specifies timesort, there are no errors/warnings while creating an event. When trying to view dashboard the "undefined" popups show up or there are fatal errors. When digging deeper one can find fatal PHP errors that terminate the script execution and WS calls return empty result.
      I'm submitting a patch that at least avoids the fatal errors for the plugin devs who will try to do the same.

      To reproduce:

      1. pick only the second commit from https://github.com/moodle/moodle/compare/master...marinaglancy:wip-MDL-58867-test
      2. create or edit a course in "Weeks" format
      3. login as a student - you will see fatal errors on the dashboard and when viewing calendar
      4. if you change the type of the event in the code from CALENDAR_EVENT_TYPE_ACTION to CALENDAR_EVENT_TYPE_STANDARD and then edit the course again and save (so that calendar event is updated) there will be no errors for student.

            marina Marina Glancy
            marina Marina Glancy
            cameron1729 cameron1729
            Dan Poltawski Dan Poltawski
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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