Closed Bug 297530 Opened 20 years ago Closed 20 years ago

calIItemBase.icalString returns properties that were never set

Categories

(Calendar :: Internal Components, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mvl, Assigned: vlad)

Details

Attachments

(4 files)

when calling .icalString on a todo or event, the string has properies that were
never set, but now have some default value, or a libical error.
Attached file xpcshell testcase —
Actual restults from the testcase: (also note that summary:foo shows up twice)
BEGIN:VCALENDAR
PRODID:-//Mozilla Calendar//NONSGML Sunbird//EN
VERSION:2.0
BEGIN:VTODO
SUMMARY:Foo
X-MOZILLA-GENERATION:undefined
PERCENT-COMPLETE:0
LAST-MODIFIED:ERROR: No Value
DTSTAMP:ERROR: No Value
SUMMARY:Foo
CREATED:ERROR: No Value
END:VTODO
END:VCALENDAR

expected:
BEGIN:VCALENDAR
PRODID:-//Mozilla Calendar//NONSGML Sunbird//EN
VERSION:2.0
BEGIN:VTODO
SUMMARY:Foo
LAST-MODIFIED:<some valid datetime>
DTSTAMP:<some valid datetime>
END:VTODO
END:VCALENDAR
The ICS serializer needs to be updated to either check item.isPropertyPromoted()
on the property name before outputting from the property bag (because right now
it's getting the summary via item.title, and is also seeing a "SUMMARY"
property, for example), or to not use item.title and do everything through
properties.

That's at least one part of the problem; the last modified and other bits I'll
look at tomorrow.
pavlov gave r+ on irc.
Attachment #186069 - Flags: first-review+
Attachment #186069 - Attachment description: patch for date issue → patch for date issue (checked in)
Attached patch more fixes (checked in) — — Splinter Review
This makes most serialization work again. It still outputs a percent-complete
and a mozilla-generation while those were never set.
Attachment #186087 - Flags: first-review?(vladimir)
Comment on attachment 186087 [details] [diff] [review]
more fixes (checked in)

Please ignore the dump() statement I added.
Comment on attachment 186087 [details] [diff] [review]
more fixes (checked in)

r=me without the dump() (or at least commented out)
Attachment #186087 - Flags: first-review?(vladimir) → first-review+
Attachment #186087 - Attachment description: more fixes → more fixes (checked in)
This patch checks if percentageComplete and generation are really set before
serializing them, so they don't show up when not set.
Attachment #186235 - Flags: first-review?(vladimir)
Attachment #186235 - Flags: first-review?(vladimir) → first-review+
last patch checked in. I think this bug is now fixed.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: