Closed Bug 359443 Opened 14 years ago Closed 13 years ago

Deleting item from Agenda deletes an email instead

Categories

(Calendar :: Lightning Only, defect)

Lightning 0.3
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ka, Assigned: berend.cornelius09)

References

Details

(Keywords: dataloss)

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

select an agenda item, press delete. previously selected email disappears.


Reproducible: Always

Steps to Reproduce:
1. select an agenda item
2. press delete. 
2.
3.




lightning 0.3 
thunderbird 1.5.0.7
Confirmed using Thunderbird/1.5.0.8 (20061025) and Lightning/0.4a1 (2006111006) on Windows 2000.

Probably the Agenda tab needs a similar fix as done with Bug 353470 for the Todo tab.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: dataloss
OS: Windows XP → Windows 2000
Summary: lightning agenda delete, similar to bug:353470 → Deleting item from Agenda tab also deletes an Email
Version: unspecified → Lightning 0.3
I see this in Thunderbird 2.0b1 ID:2006120404 (nightly) and Lightning build 2006120403, only mail gets deleted, while item stays. The title here seems to imply that item gets deleted.
This is serious bad news.  Adjusted the title.
Severity: normal → critical
Summary: Deleting item from Agenda tab also deletes an Email → Deleting item from Agenda tab deletes an email instead
*** Bug 364853 has been marked as a duplicate of this bug. ***
There should also be a regret opportunity to undo the last action.
Issue still exists with the new Today Pane using Lightning 0.7pre (2007072308).
Flags: blocking-calendar0.7?
OS: Windows 2000 → All
Hardware: PC → All
Summary: Deleting item from Agenda tab deletes an email instead → Deleting item from Agenda deletes an email instead
Flags: blocking-calendar0.7? → blocking-calendar0.7+
Berend volunteered
Assignee: nobody → Berend.Cornelius
Attached patch patch to be reviewed (obsolete) — Splinter Review
This patch takes care that the keypressed-event is handled by the agenda-pane
Attachment #281185 - Flags: review?(michael.buettner)
Comment on attachment 281185 [details] [diff] [review]
patch to be reviewed

>+agendaTreeView.onKeyPress =
>+function onKeyPress(event)
>+{
>+  const kKE = Ci.nsIDOMKeyEvent;
>+  switch(event.keyCode) {
>+    case kKE.DOM_VK_DELETE:
>+      document.getElementById('agenda_new_event_command').doCommand();
>+      this.deleteEvent();
>+      event.preventDefault();
>+      event.stopPropagation();
>+      break;
>+  }
>+};
First of all, even with this patch in place the email gets nuked when hitting the 'delete'-key. You should switch the above lines 'preventDefault()' and 'stopPropagation()' to make it work. Also, please remove the 'deleteEvent()' call, it seems to be superfluous. Furthermore, the command is named 'agenda_new_event_command' but it deletes events, this is probably a copy'n'paste bug.

>+   var selectedItems = new Array();
>+   var tree = document.getElementById("agenda-tree");
>+   var start = new Object();
>+   var end = new Object();
>+   var numRanges = tree.view.selection.getRangeCount();
>+   var t;
>+   var v;
>+   var agendaItem;
>+   for (t = 0; t < numRanges; t++) {
>+      tree.view.selection.getRangeAt(t, start, end);
>+      for (v = start.value; v <= end.value; v++) {
>+        agendaItem = this.events[v];
>+        selectedItems.push(agendaItem);
>+      }
>+   }
I suggest to introduce variables as late as possible. You could remove the declaration of the variables 't', 'v' and 'agendaItem' and write the rest as follows:
   for (var t = 0; t < numRanges; t++) {
      tree.view.selection.getRangeAt(t, start, end);
      for (var v = start.value; v <= end.value; v++) {
        selectedItems.push(this.events[v]);
      }
   }

r=mickey with the above mentioned issues being addressed. Thanks for the patch, Berend.
Attachment #281185 - Flags: review?(michael.buettner) → review+
patch checked in on trunk and MOZILLA_1_8_BRANCH
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
modified the last patch as mickey suggested
Attachment #281185 - Attachment is obsolete: true
(In reply to comment #9)
> Furthermore, the command is named
> 'agenda_new_event_command' but it deletes events, this is probably a
> copy'n'paste bug.

... which wasn't fixed before checkin. :-(
Target Milestone: --- → 0.7
(In reply to comment #12)
> (In reply to comment #9)
> > Furthermore, the command is named
> > 'agenda_new_event_command' but it deletes events, this is probably a
> > copy'n'paste bug.
> 
> ... which wasn't fixed before checkin. :-(
> 
Berend, please change the name accordingly and check it in. It's not a major problem but just adds unnecessarily confusion. Please mention in the check-in comment that it is an add-on patch.
Checked in remaining naming issue
patch checked in on trunk and MOZILLA_1_8_BRANCH.
Verified with lightning 2007092403. However it's not possible to undo the delete from agenda in mail mode
Status: RESOLVED → VERIFIED
(In reply to comment #15)
> Verified with lightning 2007092403. However it's not possible to undo the
> delete from agenda in mail mode
> 

Omar, please file a new bug for this issue.
I've filled a new bug 398405(In reply to comment #16)
> (In reply to comment #15)
> > Verified with lightning 2007092403. However it's not possible to undo the
> > delete from agenda in mail mode
> > 
> 
> Omar, please file a new bug for this issue.
> 

I've filled a new bug 398405
You need to log in before you can comment on or make changes to this bug.