Closed Bug 408237 Opened 17 years ago Closed 17 years ago

Non working code due to setting of readonly attribute 'generation' in providers

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ssitter, Assigned: dbo)

References

()

Details

Attachments

(1 file)

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.12pre) Gecko/20071213 Calendar/0.8pre

The following warnings were shown in Venkman during event creation/editing:

    Warning "aItem.generation is read-only" [-s] in file 
    "file:///D:/sunbird/js/calStorageCalendar.js", line 362.

    Warning "modifiedItem.generation is read-only" [-s] in 
    file "file:///D:/sunbird/js/calStorageCalendar.js", line 432.

generation is a readonly attribute in calIItemBase:
http://lxr.mozilla.org/mozilla/source/calendar/base/public/calIItemBase.idl#106

Dump statements before and after the modification of generation revealed that the value of generation is always 0:
http://lxr.mozilla.org/mozilla/source/calendar/providers/storage/calStorageCalendar.js#362
http://lxr.mozilla.org/mozilla/source/calendar/providers/storage/calStorageCalendar.js#432

This makes the checks on generation useless because it always passes:
http://lxr.mozilla.org/mozilla/source/calendar/providers/storage/calStorageCalendar.js#421

Similar code is used in other providers, see http://mxr.mozilla.org/mozilla/search?string=generation&find=calendar&findi=&filter=&tree=mozilla

-> Current use of generation is useless because the value is always 0. 
   Either this code should be removed or fixed.
Attached patch fix — — Splinter Review
Assignee: nobody → daniel.boelzle
Status: NEW → ASSIGNED
Attachment #293001 - Flags: review?(philipp)
Comment on attachment 293001 [details] [diff] [review]
fix

r=philipp
Attachment #293001 - Flags: review?(philipp) → review+
Thanks for catching this, Stefan!

Checked in on HEAD and MOZILLA_1_8_BRANCH.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
OS: Windows 2000 → All
Hardware: PC → All
Resolution: --- → FIXED
Target Milestone: --- → 0.8
Version: Mozilla 1.8 Branch → unspecified
verified this works now
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: