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

          Activity

          Hide
          salvetore Michael de Raadt added a comment -

          Thanks for reporting that, Joseph. And thanks for providing a patch.

          Show
          salvetore Michael de Raadt added a comment - Thanks for reporting that, Joseph. And thanks for providing a patch.
          Hide
          rezeau Joseph Rézeau added a comment -

          The patch I provided is for file mod/lesson/lib.php
          Joseph

          Show
          rezeau Joseph Rézeau added a comment - The patch I provided is for file mod/lesson/lib.php Joseph
          Hide
          rwijaya Rossiani Wijaya added a comment -

          Hi Joseph,

          Thank you for providing patch to fix this issue and it looks great.

          I created diff patch for this and will submit this for integration review.

          Show
          rwijaya Rossiani Wijaya added a comment - Hi Joseph, Thank you for providing patch to fix this issue and it looks great. I created diff patch for this and will submit this for integration review.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Thanks Rosie this has been integrated now

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks Rosie this has been integrated now
          Hide
          andyjdavis Andrew Davis added a comment -

          Works as described. Passing.

          Show
          andyjdavis Andrew Davis added a comment - Works as described. Passing.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Some changes to Moodle should be milestones in the project by themselves.

          This is not the case and your fix is not so important, but your collaboration is highly appreciated, thanks!

          Closing as fixed, ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Some changes to Moodle should be milestones in the project by themselves. This is not the case and your fix is not so important, but your collaboration is highly appreciated, thanks! Closing as fixed, ciao

            People

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

              Dates

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