Closed Bug 410287 Opened 17 years ago Closed 16 years ago

calICalendar.getProperty returns always value type string

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sebo.moz, Assigned: dbo)

References

Details

Attachments

(1 file, 1 obsolete file)

If setting a property boolean false via calICalendar.setProperty(), then calICalendar.getProperty() does not evaluate as expected.

For instance !cal.getProperty("someProperty") will not be true because it returns "0" as string.

I will attach a unit test as proof.
Flags: wanted-calendar0.8?
I needed to change calCalendarManager.js in order for the unit tests to work. Reason is, that there exists no profile for the unit tests and thus dbService.getProfileStorage("profile") always throws. 
The special case for 1.8 branch is not needed any more since it was indeed 1.8.0 branch specific.
The patch changes the "suppressAlarms" property using setProperty and checks the result using getProperty. It failes for storageCalendar since it returns always string values.
Attachment #294918 - Flags: review?(daniel.boelzle)
Attached patch workaround (obsolete) — — Splinter Review
Proposed quick workaround.
Blocks: 257428
Sebo, the WIP patch of bug 393395 incorporates a workaround for boolean properties unless we save properties into the prefs.
This bug is not important enough to warrant wanted0.8 status. 

We would however take a fix for this bug into 0.8, if such a fix materializes.
Flags: wanted-calendar0.8? → wanted-calendar0.8-
This bug blogs a wanted-0.8 bug. It is therefore important. A fix has materialized in bug 393395 (see comment 3).
Depends on: 393395
"blogs" should read "blocks", of course :-)
Assignee: nobody → sebo.moz
(In reply to comment #0)
> If setting a property boolean false via calICalendar.setProperty(), then
> calICalendar.getProperty() does not evaluate as expected.
> 
> For instance !cal.getProperty("someProperty") will not be true because it
> returns "0" as string.
This will be thoroughly fixed with bug 378754 when we shift calendar registration and prefs into the prefs. Unless that is done, we need to do the manual conversion in calProviderBase::get/setProperty. This has been done with bug 393395 for all known properties.
Comment on attachment 294918 [details] [diff] [review]
unit test for calICalendar.getProperty/setProperty

Besides that the patch contains some functions that IMO don't relate to this bug like compareItems, I think you should work on a registered calendar instead of manually setting the id.
If you wouldn't do that, then calProviderBase stores the props only transiently (IIRC bug 393395 changes that) which should be testable, too.
Attachment #294918 - Flags: review?(daniel.boelzle) → review-
No longer blocks: 257428
Flags: wanted-calendar0.8-
Depends on: 378754
Depends on: 403006
No longer depends on: 378754
Flags: wanted-calendar0.9+
Flags: wanted-calendar0.9+ → wanted-calendar1.0+
OS: Linux → All
Hardware: PC → All
fixed with bug 403006
Assignee: sebo.moz → daniel.boelzle
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → 1.0
Attachment #294920 - Attachment is obsolete: true
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: