Closed Bug 520667 Opened 14 years ago Closed 12 years ago

Pressing Select All (Ctrl + A) in the tasks view selects all the items in the calendar view


(Calendar :: Calendar Frontend, defect)

Not set


(Not tracked)



(Reporter: mlissner+bugzilla, Assigned: philmsgs)


(Blocks 1 open bug)


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


(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20090930 Ubuntu/9.04 (jaunty) Firefox/3.5.2
Build Identifier: 1.0 pre

The summary + steps to reproduce should pretty much explain it.

Reproducible: Always

Steps to Reproduce:
1. Open the calendar tab in Tb3+
2. Set it so you can see more than one event (selecting a week view is probably most dramatic)
3. Open the tasks tab
4. Press Ctrl + A to select all the tasks
5. Switch back to the calendar tab
6. Be startled that all your calendar items have turned yellow
7. Realize that they're not yellow, they're just all selected
8. File a bug.

Expected Results:  
Select all in the tasks tab should select all the TASKS, not all the calendar items across all calendars.
Flags: wanted-calendar1.0?
Flags: blocking-calendar1.0?
Confirmed using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv: Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 with Lightning nightly build 20091026, but just for day/week view, not multiweek/month view.
Component: General → Calendar Views
Ever confirmed: true
Flags: wanted-calendar1.0?
OS: Linux → All
QA Contact: general → views
Hardware: x86 → All
Flags: blocking-calendar1.0? → blocking-calendar1.0+
Whiteboard: [not needed beta][no l10n impact]
I heard of a user that tried to delete all his completed task by:

1- Setting Show to "Completed Task".
2- Select All.
3- Press <Del>.

and found out that this had actually deleted all his events for the current week!

In short, the consequence of this issue can be quite severe.
I'll try to get this fixed together with bug 527254.
Severity: normal → critical
Keywords: dataloss
My code analysis shows at least 2 problems.

In the function 'selectAllEvents' file 'calendar-views.js', a filter is constructed.
For tasks, the value is positioned with composite.ITEM_FILTER_TYPE_ALL.
composite.ITEM_FILTER_TYPE_TODO should be used. 

currentView().tasksInView is set to true only when the option 'Show Tasks in Calendar'is selected. it can be selected when calendar view is active.

filter |= composite.ITEM_FILTER_TYPE_ALL;
filter |= composite.ITEM_FILTER_TYPE_TODO;

if (currentView().tasksInView) {
var menuTask=document.getElementById("ltnMenuSwitchToTask");
if ("true"==menuTask.getAttribute("checked")) {

From tasks view, ctrl + a no longer selects the events.
However, the tasks are not selected, although the result in 'onOperationComplete' indicates a number> 0. 
Maybe a problem with:
currentView (). setSelectedItems
In the task view, selectAllEvents shouldn't be called at all, is that the case? This bug is about the task view and shouldn't have to do with the calendar view at all.
If you select "Select | All" from the Edit menu or simply type Ctrl+A while in the task view, all the date-time events in the calendar view will be selected. Note that day events are NOT selected.
yes you are right, selectAllEvents shouldn't be called at all when taskView is selected.

i saw that the command controller is the same for calendar and task view (file calendar-common-sets.js : calendarController2). On cmd_selectAll command, selectAllEvents is called.

I've made a patch that change selectAllEvents by a new function selectAllItems witch call selectAllEvents in case where calendar view is active, or selectAllTasks (new function) when taskView is active. 

selectAllTasks mark all task selected in task tree.

After some tests, i found another problem.
If we have one or more events selected, switching to mail view or task view and hitting del will delete selected items.
Comment on attachment 529984 [details] [diff] [review]
patch that select task items from task view on typing ctrl+A

Putting this patch in Philipp's queue, so it doesn't get lost. ;)
Attachment #529984 - Flags: review?(philipp)
Assignee: nobody → philippe.martinak
Comment on attachment 529984 [details] [diff] [review]
patch that select task items from task view on typing ctrl+A

Attachment #529984 - Flags: review?(philipp) → review+
Comment on attachment 529984 [details] [diff] [review]
patch that select task items from task view on typing ctrl+A

Actually, I'm going to check in something slightly different, since this patch will cause problems when selecting tasks in the mail mode today pane.
Pushed to comm-central <>
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Trunk
Backported to comm-miramar <>
Target Milestone: Trunk → 1.0b4
You need to log in before you can comment on or make changes to this bug.