Moodle

calendar double message lesson opens lesson closes

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5.2, 1.5.4, 1.6.5, 1.7.3, 1.8.3
  • Fix Version/s: 1.8.4
  • Component/s: Calendar, Lesson
  • Labels:
    None
  • Affected Branches:
    MOODLE_15_STABLE, MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE

Description

What appears as a bug here is due to the way the Moodle calendar interprets the period of time during which a lesson is open as compared to current date.

(shown here using Moodle 1.5.2+)

Example

Today is Nov. 6th

Case 1 in lesson settings, lesson is set to be available from Nov. 1st until Nov. 10th

In the calendar the only highlighted date is Nov. 10th, in which we can see the double message you mention: Lesson opens; lesson closes... twice

Case 2 in lesson settings, lesson is set to be available from Nov. 7th until Nov. 10th

In the calendar the only highlighted date is Nov. 7th, and dates 8th through 10th are boxed (i.e. they display a top and bottom border). In the calendar, if you click on Nov. 7th, it takes you to the calendar day view, where you can see the details of lesson opening and closing.

Obviously, it should be considered as a bug that when a lesson's opening date is overdue we shoud get the doubly double message in the due date box. What we should really see is a single message saying lesson closes that's all.

Joseph

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

From Jon Papaioannou (pj at moodle.org) Thursday, 24 November 2005, 06:45 AM:

Hi Joseph,

Even though I did try a lot, I couldn't replicate case #1 for me (and case #2 is obviously not a bug). Furthermore, after reading the code carefully I can't see where this bug could happen.

Are you sure this happens all the time? Is there anything special I need to do to activate the bug?

From Timothy Allen (scop at hannam.ac.kr) Wednesday, 15 March 2006, 01:17 PM:

I have almost the same problem. One of my teachers has set up a lesson with the following parameters: one page only with no question, student can repeat, timed with 2 branches.

Today is November 15, the dates of the lesson are: opening November 17, close November 24.

The upcoming events block as well as the calendar are just showing lesson opens as well as lesson closes on March 24, with no mention of the opening date.

I have attached screenshots to indicate this. This seems to be a clear bug.

Show
Martin Dougiamas added a comment - From Jon Papaioannou (pj at moodle.org) Thursday, 24 November 2005, 06:45 AM: Hi Joseph, Even though I did try a lot, I couldn't replicate case #1 for me (and case #2 is obviously not a bug). Furthermore, after reading the code carefully I can't see where this bug could happen. Are you sure this happens all the time? Is there anything special I need to do to activate the bug? From Timothy Allen (scop at hannam.ac.kr) Wednesday, 15 March 2006, 01:17 PM: I have almost the same problem. One of my teachers has set up a lesson with the following parameters: one page only with no question, student can repeat, timed with 2 branches. Today is November 15, the dates of the lesson are: opening November 17, close November 24. The upcoming events block as well as the calendar are just showing lesson opens as well as lesson closes on March 24, with no mention of the opening date. I have attached screenshots to indicate this. This seems to be a clear bug.
Hide
Michael Spall added a comment -

I can confirm that in Moodle 1.6.4 and Moodle 1.8 that when you create a lesson you have two events on the day the lesson closes and no events on the day the lesson opens.

Show
Michael Spall added a comment - I can confirm that in Moodle 1.6.4 and Moodle 1.8 that when you create a lesson you have two events on the day the lesson closes and no events on the day the lesson opens.
Hide
Harry Winkelmann added a comment -

I've the same problem!
It depends on the php Version.

The following line only creates a reference in php5.
$event2 = $event;
So event and event2 are the same.
So they are displayed twice.

In php5 the line has to be
$event2 = clone $event;
Now you have two different objects...

Found in
mod/lesson/lib.php
Line103 and 202
Moodle 1.7

This is a serious bug for me....

Show
Harry Winkelmann added a comment - I've the same problem! It depends on the php Version. The following line only creates a reference in php5. $event2 = $event; So event and event2 are the same. So they are displayed twice. In php5 the line has to be $event2 = clone $event; Now you have two different objects... Found in mod/lesson/lib.php Line103 and 202 Moodle 1.7 This is a serious bug for me....
Hide
Chris Potter added a comment -

I verified this issue with 1.8.2, but was able to correct it with the above code from Harry. Thanks!!

Show
Chris Potter added a comment - I verified this issue with 1.8.2, but was able to correct it with the above code from Harry. Thanks!!
Hide
Michael Spall added a comment -

Can someone double check this fix and if it works commit it to 1.8 and head.

Show
Michael Spall added a comment - Can someone double check this fix and if it works commit it to 1.8 and head.
Hide
Michael Spall added a comment -

Patch against MOODLE_18_STABLE

Show
Michael Spall added a comment - Patch against MOODLE_18_STABLE
Hide
Michael Spall added a comment -

This bug effects versions up to Moodle 1.8

Show
Michael Spall added a comment - This bug effects versions up to Moodle 1.8
Hide
Michael Spall added a comment -

I can confirm the fix of changing $event2 = $event; to $event2 = clone $event; works on latest Moodle 1.8. I have submitted a patch against Moodle 1.8.

Show
Michael Spall added a comment - I can confirm the fix of changing $event2 = $event; to $event2 = clone $event; works on latest Moodle 1.8. I have submitted a patch against Moodle 1.8.
Hide
Michael Spall added a comment -

I have assigned this to Mark Nielson because it is a lesson bug and not really a calendar bug and it looks like Mark is usually assigned lesson bugs.

Mark,

This bug fix has been independently verified at least 3 times and a verified patch against MOODLE_18_STABLE has been submitted. Would you please take a look and commit this to CVS. Thank you in advance.

Show
Michael Spall added a comment - I have assigned this to Mark Nielson because it is a lesson bug and not really a calendar bug and it looks like Mark is usually assigned lesson bugs. Mark, This bug fix has been independently verified at least 3 times and a verified patch against MOODLE_18_STABLE has been submitted. Would you please take a look and commit this to CVS. Thank you in advance.
Hide
Martin Dougiamas added a comment -

Yu, can you check this in?

Show
Martin Dougiamas added a comment - Yu, can you check this in?
Hide
Yu Zhang added a comment -

Code is in 1.8, I do not see the same code in 1.9.

I think the () might be needed for php4 support.

Cheers,

Yu

Show
Yu Zhang added a comment - Code is in 1.8, I do not see the same code in 1.9. I think the () might be needed for php4 support. Cheers, Yu

People

Vote (11)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: