Closed Bug 464560 Opened 11 years ago Closed 11 years ago

Error: "this.setProperty is not a function" in calAttachment.js

Categories

(Calendar :: Internal Components, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ssitter, Assigned: Fallen)

References

Details

(Keywords: regression)

Attachments

(2 files)

Attached file testcase
Opening the attached ics file fails (with the errors listed below) using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2pre) Gecko/20081112 Calendar/1.0pre

Opening works fine using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.18pre) Gecko/20080917 Sunbird/0.9.


[[[
Error: this.setProperty is not a function
Source File: file:///E:/sunbird/modules/calUtils.jsm -> file:///E:/sunbird/calendar-js/calAttachment.js
Line: 162
]]]

[[[
Parsing the file failed:[Exception... "'[JavaScript Error: "this.setProperty is not a function" {file: "file:///E:/sunbird/modules/calUtils.jsm -> file:///E:/sunbird/calendar-js/calAttachment.js" line: 162}]' when calling method: [calIAttachment::icalProperty]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: file:///E:/sunbird/modules/calUtils.jsm -> file:///E:/sunbird/calendar-js/calItemBase.js :: anonymous :: line 681"  data: yes]
]]]

[[[
Warning: There has been an error reading data for calendar: test. It has been placed in read-only mode, since changes to this calendar will likely result in data-loss.  You may change this setting by choosing 'Edit Calendar'. Error code: 0x80570021. Description: [Exception... "'[JavaScript Error: "this.setProperty is not a function" {file: "file:///E:/sunbird/modules/calUtils.jsm -> file:///E:/sunbird/calendar-js/calAttachment.js" line: 162}]' when calling method: [calIAttachment::icalProperty]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: file:///E:/sunbird/modules/calUtils.jsm -> file:///E:/sunbird/calendar-js/calItemBase.js :: anonymous :: line 681"  data: yes]
]]]

[[[
Warning: There has been an error reading data for calendar: test. Error code: READ_FAILED. Description: 
]]]
Taking, I have a patch about ready that just needs some testing. Aside from the obvious fix of using this.setParameter() (which btw also appears in calRelation.js), I noticed that setting the ical property doesn't seem to reset the property bag. Therefore a testcase similar to the following will fail:


let icalAttach1 = getICSService().createIcalProperty("ATTACH");
let icalAttach2 = getICSService().createIcalProperty("ATTACH");
let attach = cal.createAttachment();

icalAttach1.setParameter("X-THING", "FOO");

attach.icalProperty = icalAttach1;
do_check_eq(attach.getParameter("X-THING"), "FOO");
attach.icalProperty = icalAttach2;
do_check_eq(attach.getParameter("X-THING"), null);

Does this make sense? Or is there a use case for making the parameters stick?
Assignee: nobody → philipp
Flags: in-testsuite?
OS: Windows XP → All
Hardware: PC → All
IMO setting the icalProperty must fully reset the object; I think your test case makes sense.
Flags: blocking-calendar1.0?
Attached patch Fix - v1Splinter Review
This should take care, requires iterators patch from bug 463047 to be applied.
Attachment #348194 - Flags: review?(daniel.boelzle)
Status: NEW → ASSIGNED
Attachment #348194 - Flags: review?(daniel.boelzle) → review+
Comment on attachment 348194 [details] [diff] [review]
Fix - v1

looks good; r=dbo
Duplicate of this bug: 461405
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/892e9f783d9e>

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite?
Flags: in-testsuite+
Flags: blocking-calendar1.0?
Resolution: --- → FIXED
Target Milestone: --- → 1.0
Checked in lightning build 20081130 -> VERIFIED.
Status: RESOLVED → VERIFIED
These bugs are likely targeted at Lightning 1.0b1, not Lightning 1.0. If this change was done in error, please adjust the target milestone to its correct value. To filter on this bugspam, you can use "lightning-10-target-move".
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.