Closed Bug 435904 Opened 18 years ago Closed 18 years ago

untitled tasks generate an exception when sorting

Categories

(Calendar :: Tasks, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: WSourdeau, Assigned: dbo)

Details

(Whiteboard: [good first bug])

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fr-FR; rv:1.8.1.14) Gecko/20080404 Iceweasel/2.0.0.14 (Debian-2.0.0.14-2) Build Identifier: 0.8 2008051319 When certain tasks have no title, the following exception occurs and few or no task appears in the list: Erreur : [Exception... "'[JavaScript Error: "a.title has no properties" {file: "chrome://calendar/content/calendar-task-tree.xml" line: 1045}]' when calling method: [calIOperationListener::onOperationComplete]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS frame :: file:///usr/lib/icedove/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/js/calMemoryCalendar.js :: anonymous :: line 446" data: yes] STACK: 1: [file:///usr/lib/icedove/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/js/calUtils.js:1711] notifyFunc 2: [null:0] null 3: [file:///usr/lib/icedove/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/js/calUtils.js:1714] calListenerBag_notify 4: [file:///usr/lib/icedove/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/components/calCompositeCalendar.js:197] anonymous 5: [null:0] null Fichier source : file:///usr/lib/icedove/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/js/calUtils.js Ligne : 1711 The line in question contains "a.title.toLowercase()", where title is null or undefined. In the same file, the title is revolved with gCalendarBundle.getString("eventUntitled") when null. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Confirmed using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15pre) Gecko/20080527 Calendar/0.9pre If the task has no name the following error is shown frequently in Console: Error: gCalendarBundle has no properties Source File: chrome://calendar/content/calendar-task-tree.xml Line: 449 http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/calendar/base/content/calendar-task-tree.xml&rev=1.30&mark=449#440 Error: a.title has no properties Source File: chrome://calendar/content/calendar-task-tree.xml Line: 1067 http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/calendar/base/content/calendar-task-tree.xml&rev=1.30&mark=1067#1060
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hardware: PC → All
Whiteboard: [good first bug]
Seems to be in right from the start, occurs on 0.8, too... :(
Attached patch fix (obsolete) β€” β€” Splinter Review
Don't know if there's a better fix, but this one works for me.
Assignee: nobody → daniel.boelzle
Status: NEW → ASSIGNED
Attachment #322818 - Flags: review?(philipp)
Comment on attachment 322818 [details] [diff] [review] fix >-<script type="application/x-javascript"> >- var gCalendarBundle = document.getElementById("bundle_calendar"); >-</script> ... >- <stringbundle id="bundle_calendar" src="chrome://calendar/locale/calendar.properties"/> I think I've removed this bundle before, and something important required it. ssitter probably knows when and why to not remove it. r=philipp
Attachment #322818 - Flags: review?(philipp) → review+
If I understand the patch correctly it just fixes the display issue (the first error). Or does this also fix sorting (the second error)?
Attached patch fix - v2 (obsolete) β€” β€” Splinter Review
Right, I didn't pay attention to that part.
Attachment #322818 - Attachment is obsolete: true
Attachment #322928 - Flags: review?(philipp)
Comment on attachment 322928 [details] [diff] [review] fix - v2 >- return compareString(a.title.toLowerCase(), b.title.toLowerCase()) * modifier; >+ return compareString(a.title, b.title) * modifier; Wouldn't this make the compare case sensitive, e.g. "abc" is listed after "ZZZtop"?
Comment on attachment 322928 [details] [diff] [review] fix - v2 Right again, I've wondered why we don't use lexical string comparison as is. Now I know why. Stefan, I am asking myself, why you don't fix this bug...
Attachment #322928 - Attachment is obsolete: true
Attachment #322928 - Flags: review?(philipp)
Attached patch fix - v3 β€” β€” Splinter Review
Attachment #322933 - Flags: review?(ssitter)
Comment on attachment 322933 [details] [diff] [review] fix - v3 r=ssitter
Attachment #322933 - Flags: review?(ssitter) → review+
Checked in on HEAD and MOZILLA_1_8_BRANCH => FIXED.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.9
Checked in lightning 2008061918 and Sunbird 20080619 -> VERIFIED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: