Closed Bug 357147 Opened 14 years ago Closed 14 years ago

cloned proxies forget about attendee list

Categories

(Calendar :: General, defect)

x86
All
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: michael.buettner, Assigned: michael.buettner)

Details

Attachments

(1 file)

in case an occurrence is cloned the reference to the list of the attendees gets lost. as soon as getAttendees({}) is called this reference gets reconstructed from its parent. but in case one tries to extract the icalString from the cloned occurrence the attendees appear to be lost since the reference to the list of attendees happens to be null. so basically occurrence.icalString returns a different result than occurrence.clone().icalString.
Attached patch patch v1Splinter Review
this patch fixes the problem. just instead of directly accessing the 'mAttendee'-array we need to call getAttendees({}) in order to retrieve the correct array. in case we do this for a cloned proxy this reconstructs the reference to be the same as the parent item.
Attachment #242655 - Flags: first-review?(dmose)
Comment on attachment 242655 [details] [diff] [review]
patch v1

Moving reviews to ctalbert and lilmatt per dmose
Attachment #242655 - Flags: second-review?(lilmatt)
Attachment #242655 - Flags: first-review?(dmose)
Attachment #242655 - Flags: first-review?(cmtalbert)
Comment on attachment 242655 [details] [diff] [review]
patch v1

Looks good. Sorry it took so long to get to this.
Attachment #242655 - Flags: first-review?(cmtalbert) → first-review+
Comment on attachment 242655 [details] [diff] [review]
patch v1

>+        var attendees = this.getAttendees({});
>+        if (attendees.length > 0) {
>+            for (var i = 0; i < attendees.length; i++)
>+                icalcomp.addProperty(attendees[i].icalProperty);
>         }

nit: Add curly braces to the for statment.

r+ with that
Attachment #242655 - Flags: second-review?(lilmatt) → second-review+
Patch checked in on MOZILLA_1_8_BRANCH and trunk.

-> FIXED
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.