Closed
Bug 372855
Opened 19 years ago
Closed 19 years ago
getOccurrencesBetween() in calTodo.js fails on tasks without entryDate or dueDate
Categories
(Calendar :: Internal Components, defect)
Calendar
Internal Components
Tracking
(Not tracked)
VERIFIED
FIXED
Sunbird 0.5
People
(Reporter: ssitter, Assigned: ssitter)
References
Details
(Keywords: regression, Whiteboard: [patch in hand][no l10n impact])
Attachments
(1 file, 1 obsolete file)
|
3.12 KB,
patch
|
jminta
:
first-review+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.3pre) Gecko/20070306 Calendar/0.5pre
getOccurrencesBetween() in calTodo.js fails on tasks without entryDate or dueDate. The following error is reported in ensureDateTime() in calUtils.js:
Error: aDate has no properties
Source File: file:///D:/sunbird/js/calUtils.js Line: 561
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/calendar/base/src/calTodo.js&rev=1.15.2.8&mark=254-258#245
Steps to Reproduce:
1. Start with clean profile
2. Enable View -> Tasks in View
3. Create a new task and set either Start Date or Due Date set
4. Check console and views
5. Edit the task and set both Start Date or Due Date set
6. Check console and views
Actual Results:
After step 4. and 6. the error message from above is shown several times. No task visible in main calendar view.
Expected Results:
No error message. After step 6. the task should be displayed in main calendar view.
| Assignee | ||
Comment 1•19 years ago
|
||
This removes the regression caused by Bug 353707. Previously convertDate() in calTodo.js used to return null if no argument is passed in. Restoring this behavior fixes getOccurrencesBetween().
After that findColumnsForItem(), doAddEvent() and doDeleteEvent() in multiday-view had to be fixed to work correctly on tasks with only entryDate or dueDate set.
With that patch the task is correctly added/removed to display after creating or editing. Repeating tasks and Drag and Drop also works (except the known issues).
| Assignee | ||
Comment 2•19 years ago
|
||
This patch should fix the regression caused by Bug 353707 and should also fix Bug 353066 that is marked blocking 0.5. Therefore also requesting blocking 0.5.
Flags: blocking-calendar0.5?
Keywords: regression
Updated•19 years ago
|
Whiteboard: [patch in hand] [needs review jminta] [no l10n impact]
Target Milestone: --- → Sunbird 0.5
Comment 4•19 years ago
|
||
Comment on attachment 258336 [details] [diff] [review]
rev0 - fix regression and views
- var startDate = aItem.startDate || aItem.entryDate;
+ var startDate = aItem.startDate || aItem.entryDate || aItem.dueDate;
I don't understand the need for these changes. onGetResult, onAddItem, onModifyItem, and onDeleteItem all enforce the rule that a task must have both an entryDate and a dueDate. Can you show me what codepath we're taking where this problem can be hit?
| Assignee | ||
Comment 5•19 years ago
|
||
(In reply to comment #4)
The following workflow triggered the error:
- Enable Tasks in View
- Create task with only start date -> task is not shown in view as expected
- Modify task and add due date -> Error: endDate has no properties in findColumnsForItem()
- Enable Tasks in View
- Create task with only due date -> task is not shown in view as expected
- Modify task and add start date -> Error: startDate has no properties in findColumnsForItem()
| Assignee | ||
Comment 6•19 years ago
|
||
Upon further looking it seems that the real problem is that onModifyItem() removes the old item twice: Once after checking if the item is an event or a task with start and due date and a few lines later again without any check. The latter one called doDeleteEvent() that called findColumnsForItem().
Attachment #258336 -
Attachment is obsolete: true
Attachment #259191 -
Flags: first-review?(jminta)
Attachment #258336 -
Flags: first-review?(jminta)
Comment 7•19 years ago
|
||
Comment on attachment 259191 [details] [diff] [review]
rev1 - fix regression and views
I like this one much better. :-)
r=jminta
Attachment #259191 -
Flags: first-review?(jminta) → first-review+
| Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch in hand] [needs review jminta] [no l10n impact] → [patch in hand][no l10n impact][needs checkin]
Comment 8•19 years ago
|
||
Checked in on trunk and MOZILLA_1_8_BRANCH
-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [patch in hand][no l10n impact][needs checkin] → [patch in hand][no l10n impact]
Comment 9•19 years ago
|
||
VERIFIED with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4pre) Gecko/20070522 Calendar/0.5pre.
Status: RESOLVED → VERIFIED
Updated•18 years ago
|
Flags: blocking-calendar0.5+
You need to log in
before you can comment on or make changes to this bug.
Description
•