Closed Bug 331701 Opened 18 years ago Closed 18 years ago

Events created via dra'n'drop should be stored in selected calendar

Categories

(Calendar :: Sunbird Only, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ssitter, Assigned: jminta)

Details

Attachments

(1 file, 1 obsolete file)

Events created via dra'n'drop should be stored in selected calendar

Steps to Reproduce:
1. Create two or more local calendars (use colors for better differentiation)
2. Go to 'Calendars' tab and select any calendar except the first one
3. Go to Day or Week view and create an event via drag and drop

Actual Results:
The event is created and stored in the first calendar that is listed in 'Calendars' tab regardless which one is selected. Open the Edit Event dialog to verify this.

Expected Results:
The event is created and stored in the currently selected calendar.

Additional Information:
Tested with Sunbird 0.3a1+ (20060325). It works in Lightning so this bug is Sunbird only.
Attached patch simple patch (obsolete) — Splinter Review
This is the simple fix.  The trickier, perhaps more correct, fix is to set the composite calendar's default calendar whenever the listbox gets selected.  Unfortunately, this seemed to keep throwing me into an infinite loop, which was highly uncool.
Attachment #216220 - Flags: first-review?(mvl)
Comment on attachment 216220 [details] [diff] [review]
simple patch

>-        doTransaction('add', event, aCalendar, null, null);
>+        var calendar = getSelectedCalendarOrNull() || aCalendar;
>+        doTransaction('add', event, calendar, null, null);

This will always create the calendar in the selected calendar, and ignore the passed in parameter. Shouldn't it be the other way around? use aCalendar is available, otherwise the default. That seems to be what lightning does.
Attached patch correct patchSplinter Review
This is the correct patch.  The composite calendar actually uses a calendar preference internally, which was sticking us in an infinite loop when setCalendarUI() rebuilt the list, and hence reselected.
Assignee: nobody → jminta
Attachment #216220 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #216369 - Flags: first-review?(mvl)
Attachment #216220 - Flags: first-review?(mvl)
Comment on attachment 216369 [details] [diff] [review]
correct patch

yes, this looks better.
r=mvl
Attachment #216369 - Flags: first-review?(mvl) → first-review+
Patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
verified with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060929 Sunbird/0.3
Status: RESOLVED → VERIFIED
Whiteboard: [litmus testcase wanted]
Litmus testcase 2610 created
Whiteboard: [litmus testcase wanted]
You need to log in before you can comment on or make changes to this bug.