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

Missing "Lesson closes" event in calendar

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.7, 2.1, 2.2
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide

      Create lesson with "Available from" and "Deadline" options activated.
      Make sure "Available from" is set BEFORE current date and "Deadline" is set AFTER current date.
      In calendar block, check that both "Lesson opens" and "Lesson closes" events are displayed.

      Show
      Create lesson with "Available from" and "Deadline" options activated. Make sure "Available from" is set BEFORE current date and "Deadline" is set AFTER current date. In calendar block, check that both "Lesson opens" and "Lesson closes" events are displayed.
    • Workaround:
      Hide

      Easy fix:

      @@ -659,7 +659,8 @@ function lesson_process_post_save(&$lesson) {
               if ($lesson->available) {
                   $event->name = $lesson->name.' ('.get_string('lessonopens', 'lesson').')';
                   calendar_event::create(clone($event));
      -        } else if ($lesson->deadline) {
      +        } 
      +        if ($lesson->deadline) {
                   $event->name      = $lesson->name.' ('.get_string('lessoncloses', 'lesson').')';
                   $event->timestart = $lesson->deadline;
                   $event->eventtype = 'close';

      Show
      Easy fix: @@ -659,7 +659,8 @@ function lesson_process_post_save(&$lesson) { if ($lesson->available) { $event->name = $lesson->name.' ('.get_string('lessonopens', 'lesson').')'; calendar_event::create(clone($event)); - } else if ($lesson->deadline) { + } + if ($lesson->deadline) { $event->name = $lesson->name.' ('.get_string('lessoncloses', 'lesson').')'; $event->timestart = $lesson->deadline; $event->eventtype = 'close';
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Missing "Lesson closes" event in calendar in all Moodle 2 versions.
      See moodle.org/mod/forum/discuss.php?d=195634

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Mar/12