Closed Bug 476132 Opened 15 years ago Closed 15 years ago

Impossible to move event by drag&drop if another event is selected on the same day in day/week view

Categories

(Calendar :: Calendar Frontend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bv1578, Assigned: sebo.moz)

Details

(Keywords: regression, Whiteboard: [not needed beta][no l10n impact])

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090128 Lightning/1.0pre (20090129) Shredder/3.0b2pre  

While in week view and an event is selected (his color is yellow), if you move another event by drag'n'drop, and drop it on the same day of the selected one, the first one keeps his selected state and it's impossible to move again the second event because an error appears in the console.
A second try to move the event causes a MODIFICATION_FAILED error.
The same occurs in day view: if an event is selected it's impossible to move another one.

Reproducible: Always

Steps to Reproduce:
1. In week view create two event in different days;
2. click on an event to select it (his box has the yellow color of selected events);
3. drag and drop the other event on the same day where the selected one is in; 
4. try to move the event inside the same day or on another day -> error on console;
5. try to move it again -> Modification error message;
Actual Results:  
After step 3
the first event is still selected while it shouldn't (at least this is Lightning 0.9 behavior).
After step 4
the box doesn't move anymore (although his shadow suggests it does) and an error message appears on the console.
After step 5
an error message "MODIFICATION_FAILED" pops up with a warning and another error message in the console.

Expected Results:  
Should be possible to move the event and the first one shouldn't be selected when you move another event on the same day.

Error after step 4 (xxx is Lightning's path):

Error: [Exception... "'[JavaScript Error: "a.occurrence is undefined" {file: "chrome://calendar/content/calendar-multiday-view.xml" line: 530}]' when calling method: [calIObserver::onModifyItem]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calUtils.js :: notifyFunc :: line 1215"  data: yes] STACK: 1: [file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calUtils.js:1218] notifyFunc
2: [file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calUtils.js:1221] calListenerBag_notify
3: [file:///C:/xxx/components/calCompositeCalendar.js:82] anonymous
4: [null:0] null
5: [file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calUtils.js:1215] notifyFunc
6: [file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calUtils.js:1221] calListenerBag_notify
7: [file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calStorageCalendar.js:572] anonymous
8: [null:0] null
9: [file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calTransactionManager.js:212] cT_doTransaction
10: [null:0] null

Source File: file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calUtils.js
Line: 1218

Error after step 5:

Warning: There has been an error reading data for calendar: Home. Error code: 0x80004005. Description: generation too old for for modifyItem

Error: An error occurred when writing to the calendar Home! Error code: MODIFICATION_FAILED. Description: 
Source File: file:///C:/xxx/modules/calUtils.jsm -> file:///C:/xxx/calendar-js/calCalendarManager.js
Line: 896
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: x86 → All
Bug occurs also in multiweek/month view.
Severity: normal → major
Flags: blocking-calendar1.0?
Severity: major → normal
Keywords: regression
Version: unspecified → Trunk
(In reply to comment #1)
> Bug occurs also in multiweek/month view.

As far as I can see I can't reproduce it in multiweek/month view.
When I select an event and then try to move another one, the first one loses the selected state and no error appears in the console when I try to move again the second event.
Version: Trunk → unspecified
Looks blocking to me. Berend, any ideas?
Flags: blocking-calendar1.0? → blocking-calendar1.0+
last version without this bug: 20081013
first with bug: 20081014

@Decathlon: It is only possible for me to get this error in multiweek/month
after the error happens one time in the weekview. If I try this directly after
thunderbird restart in the multiweek/month view the error doesn't occurs.
(In reply to comment #4)

> @Decathlon: It is only possible for me to get this error in multiweek/month
> after the error happens one time in the weekview. If I try this directly after
> thunderbird restart in the multiweek/month view the error doesn't occurs.

Sorry, you are right, it happens to me too.
Whiteboard: [not needed beta][no l10n impact]
Summary: In day/week views it's impossible to move an event by drag and drop if another event is already selected in the same day (with error) → Impossible to move event by drag&drop if another event is selected on the same day in day/week view
Assignee: nobody → sebo.moz
Status: NEW → ASSIGNED
Attachment #363692 - Flags: review?
Attachment #363692 - Flags: review? → review?(philipp)
Maybe I'm doing something wrong, but I can't reproduce this. I also don't quite see what the patch actually changes. Maybe someone can give me an updated set of STR and explain.
Attached image Steps to reproduce
In the attached image, when you move the event not selected ('Event 2'), the other ('Event 1') remains selected; when you try to move for the second time 'Event 2', you get errors in the console and the event doesn't change position.
Instead, with the patch, when you move 'Event 2' the other one lose selected status and, if you move another time, no error appears in the console.
With the patch, behavior is the same as Lightning 0.9 but shouldn't the moved event get the selected status when you click on it?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090304 Calendar/1.0pre

I managed to reproduce the error sporadically. Seems related to whether the unifinder is visible or not and how far you move the event. 

Although the error is displayed and the event is not shown it has been moved to the new date and time. If you refresh the view (e.g. by pressing Go To Today button) the event is displayed at its new position. 

If you don't refresh the view and try to move the previous event state again it fails with MODIFICATION_FAILED (Error code: 0x80004005. Description: generation too old for for modifyItem) as reported.
(In reply to comment #7)
> Maybe I'm doing something wrong, but I can't reproduce this. I also don't quite
> see what the patch actually changes.
What does |this.calendarView.selectedItem = this.mOccurrence;| do? 
The calendarView does not have the property "selectedItem" as far as I can tell. At least it does not result in a visible selection.

Are the STR from comment 8 sufficient? Otherwise I can give detailed steps as well.
Comment on attachment 363692 [details] [diff] [review]
change selection on drag v1

There was one other occurrence of selectItem, I changed that too.

I think we should give the selection issue a complete workover in a different bug, it has many flaws. We should:

* use a hash map to easier find out if an item is selected.

* Since the view, column and event boxes don't work on their own anyway, we might want to get the selection from the view instead of selecting/unselecting all of the time.

* Keep selection when modifying

all in a different bug.
Attachment #363692 - Flags: review?(philipp) → review+
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/259fcd300aec>

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
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.