Closed Bug 508295 Opened 15 years ago Closed 15 years ago

Task list: creating new task via double click or context menu entry fails


(Calendar :: Tasks, defect)

Not set


(Not tracked)



(Reporter: ssitter, Assigned: mmecca)



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


(2 files)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090804 Calendar/1.0pre

Task list: creating new task via double click or context menu entry fails

Steps to Reproduce:
1. Start Sunbird with new profile
2. Select a non-read-only calendar that supports tasks
3. Double click into empty area of task list to create a new task
4. Right click into task list and choose New Task... from context menu

Actual Results:
Nothing happens. 

Expected Results:
New Task dialog opens.

Additional Information:
Step 3 fails with the following message in Error Console:
Error: agendaListbox is not defined
Source File: chrome://calendar/content/calendar-task-tree.xml
Line: 1159

Step 4 fails with the following message in Console:
An error occurred executing the calendar_new_todo_todaypane_command command

[Exception... "'[JavaScript Error: "agendaListbox is not defined" {file: "chrome://calendar/content/calendar-common-sets.js" line: 331}]' when calling method: [nsIController::doCommand]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/globalOverlay.js :: goDoCommand :: line 86"  data: yes]

Regression Range: 
Works in Sunbird 1.0pre (BuildID: 20090803053807)
Fails in Sunbird 1.0pre (BuildID: 20090804031953)
Checkins during regression range:

Regressed by the checkin for Bug 411849.
Flags: blocking-calendar1.0?
Blocks: 411849
Flags: blocking-calendar1.0? → blocking-calendar1.0+
Whiteboard: [needed beta][no l10n impact]
Seems to only affect Sunbird where agendaListbox is not defined.
Attached patch Proposed Patch β€” β€” Splinter Review
Adds a check for Sunbird before referencing the agendaListbox in calendar-task-tree.xml and calendar-common-sets.js
Attachment #392769 - Flags: review?(philipp)
Assignee: nobody → matthew.mecca
Comment on attachment 392769 [details] [diff] [review]
Proposed Patch

While isSunbird is easy, I'd rather try to keep use of it to a minimum, since it makes the core calendar code very app specific.

I think a nicer solution would be to revert the element name to calendar-task-tree in calendar-unifinder-todo.xul, remove the css rules specifc to calendar-task-tree-todaypane and then add a rule in lightning/content/lightning-widgets.css that makes calendar-task-tree use the binding for the todaypane. This way for most calendar code, the original binding will be used, but lightning has its special css rule to use the todaypane task tree. You might have to increase the specificity of the rule to make sure it gets used, see I guess you'll find out though, it may work with a rule of the same specificity.

If we want go all the way, then we put the lightning specific bindings in lightning/content, but then again we should probably also move the agendaListbox.

For the context menu it would also be nice to not depend on isSunbird, but right now I don't see a good solution, I don't quite foresee how my above suggestion might change the problem.

What do you think? Does this make sense? Also, Matthew you should coordinate with Decathlon, he wanted to attach a patch too. I don't really mind who takes care, but you probably want to avoid double work. Thanks for the patch though
Attachment #392769 - Flags: review?(philipp) → review-
I've talked to Matthew Mecca and since this bug is my fault, I would try to work on it to put right Sunbird behavior.

I've done as suggested in comment #3 about calendar-task-tree binding and this patch seems working on Lightning AND Sunbird.

I've still used 'isSunbird' function for the context menu to hide Lightning-specific menu items when Sunbird is running.
If the patch is right maybe we might restore Sunbird's tasks, then we might think about different ways to adapt the context menu to Sunbird (or Lightning).
Attachment #393938 - Flags: review?(philipp)
Comment on attachment 393938 [details] [diff] [review]
patch with extended binding only for todaypane

Looks great, r=philipp

The only nit I have is to use cal.isSunbird() instead so we can at some point transition to using calUtils.jsm instead of calUtils.js

I'll fix this before checkin.
Attachment #393938 - Flags: review?(philipp) → review+
Pushed to comm-central <>

Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
wfm with current nightly:

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/20090812 Calendar/1.0pre

thanks for fixing this!
verified with
Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv: Gecko/20091025 Calendar/1.0pre
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.