Closed Bug 372879 Opened 17 years ago Closed 17 years ago

Tasks sort incorrectly if a Due Date is blank

Categories

(Calendar :: Tasks, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: freakent, Unassigned)

References

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3pre) Gecko/20070306 Calendar/0.5pre

I have 4 tasks; 3 with start and due dates, 1 with just a start date. If I click the due date column heading the task with a blank due date appears 2nd or 3rd in llist depending on sort direction. Errors in the console say 
Error: aDate has no properties
Source File: file:///C:/Program%20Files/Calendar/js/calUtils.js
Line: 561

Reproducible: Always

Steps to Reproduce:
1. Create 4 tasks with all with start dates, 3 with due dates
2. Expand task area to show more columns and ensure start date and due date are visible.
3. Click the column heading for due date
4. Look at the error console
Actual Results:  
Sorted due date as:
06 March 2007 14:56
06 March 2007 16:15
[blank field]
06 March 2007 21:50

Expected Results:  
Sorted due date as:
[blank field]
06 March 2007 14:56
06 March 2007 16:15
06 March 2007 21:50
Attached image Screen shot (look bottom left) —
The error message is probably caused by the issue in Bug 372855.
I'm not sure if this also affects sort order.
When you create 3 tasks with start and due dates and 2 others without any dates there's no error in console. Sorting works but after restarting Sunbird the task list is messed---> look in my bug report to see the screenshots.
Task sorting works with previous calendar versions. Should it be marked as a regression and fixed before releasing 0.5?
I have found another problem with sorting. On my list it looks like the tasks are sorted in priority order after restart. When I click priority icon to sort the tasks the arrow stays next to due text:

1.Install Sunbird 0.5 (20070317)
2.Create 5 tasks:
-two without dates (the first with normal and the second with high priority)
-3rd: start date 15/03/07 19:00, end date 19/03/07 22:00
-4th: start date 28/03/07 23:17, end date 04/04/07 23:17 (high priority)
-5th: start date 14/03/08 23:17, end date 14/03/08 23:47
3.Sort the tasks according to due date (tasks without dates are at the top, 5th
task is at the bottom
4.Restart---> the task list is sorted in priority order (if it's not working restart again)
5.Click priority icon to sort in this order---> arrow is still next to due text
Flags: blocking-calendar0.5?
(In reply to comment #5)
> Task sorting works with previous calendar versions. 
> Should it be marked as a regression and fixed before releasing 0.5?

This is no regression. Sunbird 0.3 alpha1 sorts the same way as Sunbird 0.5pre does. 

What happens is the following: If the tasks should be sorted by date but no date is set for the task the current date is used for sorting. So if you sort by due date you will first see all tasks with due date before now, followed by all tasks without due date, followed by all tasks with due date after now. 

This behavior was added with Bug 307137. See Bug 307137 Comment #7 for explanation.
This patch fixes the issue reported with Bug 373703 that was unfortunately declared a duplicate of this bug. 
Cause is that the sortActive attribute was set for the priority column. After restart the task list was always sorted by this column. After removing the attributes the sort order after restart is the same as before.
Attachment #258948 - Flags: first-review?(lilmatt)
Comment on attachment 258948 [details] [diff] [review]
rev0 - patch for 'List of tasks is not sorted after restart' issue [checked in]

That line was added in bug 357384 in order to sort tasks by priority on start.

Should that not be the case?
(In reply to comment #10)
> That line was added in bug 357384 in order to sort tasks by 
> priority on start. Should that not be the case?

I think Sunbird/Lightning should preserve the users sort decision and not force a sort by priority on start. If the user decided to sort by priority this will be preserved in any case.
This is a minor issue and doesn't block 0.5.  However it may indeed be fixed in time to make the release.
Flags: blocking-calendar0.5? → blocking-calendar0.5-
Comment on attachment 258948 [details] [diff] [review]
rev0 - patch for 'List of tasks is not sorted after restart' issue [checked in]

I was more interested in what we want to sort by on first run, but I guess that's a different but related issue.

r=lilmatt
Attachment #258948 - Flags: first-review?(lilmatt) → first-review+
Attachment #258948 - Attachment description: rev0 - patch for 'List of tasks is not sorted after restart' issue → rev0 - patch for 'List of tasks is not sorted after restart' issue [checked in]
(In reply to comment #13)
> (From update of attachment 258948 [details] [diff] [review])

Is the patch checked in? Sorting still doesn't work
It is, but it won't solve the main issue, hence this bug remaining open.  It fixes the issue reported with bug 373703 that was erroneously duped against this bug. 

http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/calendar/sunbird/base/content&command=DIFF_FRAMESET&root=/cvsroot&file=calendar.xul&rev1=1.51&rev2=1.52
Back to the original sorting issue: 
The current sorting behavior works as specified, see Comment #8 above. Therefore this bug would be either invalid/wontfix or the specified behavior needs to be changed.
OS: Windows XP → All
Hardware: PC → All
Whiteboard: [qa discussion needed]
Since this is mostly working as designed, we are going to WONTFIX this bug, and discuss any remaining issues in bug 377041.  So, if you still have comments or an idea for a different sorting method, please follow up in bug 377041.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
Whiteboard: [qa discussion needed]
Flags: blocking-calendar0.5-
I can understand the rationale for considering "no date = today", but unfortunately, this doesn't correspond to the way how *I* work. And given then number of comments on this bug, I'm apparently not alone. So, in order to make everybody happy, shouldn't this behavior be configurable?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: