Closed Bug 1300849 Opened 5 years ago Closed 5 years ago

Error shown when opening New Event / New Task dialog [TypeError: completedCommand is null]


(Calendar :: Dialogs, defect)

Lightning 5.3
Not set


(Not tracked)



(Reporter: ssitter, Assigned: Taraman)



(Keywords: regression)


(1 file, 1 obsolete file)

Thunderbird 51.0a1 (20160905030200) with built-in Lightning and fresh profile

Steps to reproduce:
Open the New Event / New Task dialog

Actual result:
Error Console shows:

TypeError: completedCommand is null 
  updateMarkCompletedMenuItem chrome://lightning/content/lightning-item-panel.js:766:5
  updateItemTabState chrome://lightning/content/lightning-item-panel.js:296:13
  receiveMessage chrome://lightning/content/lightning-item-panel.js:122:13
Blocks: 1277972
Duplicate of this bug: 1309888
Blocks: ltn54
I think, I found the cause:
It's the call "updateConfigState(gConfig);" in [1]
Since gConfig always has a property "percentComplete" set, in [2] the function "updateMarkCompletedMenuItem(aArg)" gets called.

So we should make sure, that gConfig.percentComplete is only set if we are in a tab.

regression from bug 1297737

QA Contact: Mozilla
Assignee: nobody → Mozilla
QA Contact: Mozilla
Blocks: 1308324
Attached patch Fix V1 (obsolete) — Splinter Review
Comment on attachment 8805108 [details] [diff] [review]
Fix V1

This changes the gConfig object, so that percentComplete is only set in case we are in a Tab.
Attachment #8805108 - Flags: review?(philipp)
Comment on attachment 8805108 [details] [diff] [review]
Fix V1

Review of attachment 8805108 [details] [diff] [review]:

r+ with the following change:

::: calendar/lightning/content/lightning-item-iframe.js
@@ +52,4 @@
>      privacy: null,
>      status: "NONE",
>      showTimeAs: null,
> +    // percentComplete: 0

I'd prefer keeping percentComplete in the gConfig object instead of setting new members somewhere down in the code. If there is a check that depends on percentComplete being defined, then that should be changed to check for something else.
Attachment #8805108 - Flags: review?(philipp) → review+
Attached patch Fix V2Splinter Review
Since the call to the respective function is done by simply passing the whole object, it will execute in any case, when gConfig.percentComplete is set.

This is why I chose this approach.

But we can also catch the call at another place.
The downside is, that this causes at least one uneeded function call.
Attachment #8805108 - Attachment is obsolete: true
Attachment #8805280 - Flags: review?(philipp)
Attachment #8805280 - Flags: review?(philipp) → review+
Pushed to comm-central:
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 5.1
Target Milestone: 5.1 → 5.4
You need to log in before you can comment on or make changes to this bug.