Closed
Bug 902916
Opened 12 years ago
Closed 12 years ago
calendar-occurrence-prompt is not initialized correctly [Error: 'ReferenceError: cal is not defined' in calUtils.js]
Categories
(Calendar :: Dialogs, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
3.0
People
(Reporter: Taraman, Assigned: Taraman)
References
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
1.14 KB,
patch
|
Fallen
:
review+
Fallen
:
approval-calendar-aurora+
Fallen
:
approval-calendar-beta+
Fallen
:
checkin+
|
Details | Diff | Splinter Review |
4.20 KB,
patch
|
Fallen
:
review+
|
Details | Diff | Splinter Review |
User Agent Mozilla/5.0 (X11; Linux i686; rv:26.0) Gecko/20100101 Thunderbird/26.0a1
Lightning 2.8a1
when doubleclicking an occurrence of a recurring item, the dialog opens, but it seems, the onload function is not called.
Title and properties are not set and thus the dialog is unusable.
Assignee | ||
Comment 1•12 years ago
|
||
This is caused by rev b532ed24389a
Don't know why yet.
[1]: http://hg.mozilla.org/comm-central/rev/b532ed24389a
Comment 2•12 years ago
|
||
Confirmed on 2.7. Bug 788004 was fixed for 2.6 therefore this might be broken on comm-beta too.
Error: ReferenceError: cal is not defined
Source file: chrome://calendar/content/calUtils.js
Line: 459
Blocks: 788004
Version: Trunk → Lightning 2.6
Updated•12 years ago
|
Summary: calendar-occurrence-prompt is not initialized correctly → calendar-occurrence-prompt is not initialized correctly [Error: 'ReferenceError: cal is not defined' in calUtils.js]
Assignee | ||
Comment 3•12 years ago
|
||
Thanks Stefan, that was a goog clue - I didn't get this error message for some reason.
Now cal is defined in calUtils.js
Comment 4•12 years ago
|
||
Comment on attachment 788009 [details] [diff] [review]
Patch V1
This might not be the best idea: calUtils.jsm loads the calUtils.js functions, and now you are kind of creating a circular dependency. It will probably work since the file is only loaded once, but I'm not sure its best.
I see two other options solving this:
1) Rewrite the code in calendar-occurrence-prompt.xul to use calUtils.jsm, which means it will be loaded, then calUtils.js will have it available
2) Remove the cal namespace from functions in calUtils.js if it references a function in calUtils.js itself, or move the function to the jsm if it references a function in the jsm file.
Option 1 is really a band-aid, since it will likely fail for the next dialog that doesn't load calUtils.jsm. Option 2 is probably good preparation for actually moving to calUtils.jsm.
Attachment #788009 -
Flags: review?(philipp) → review-
Comment 5•12 years ago
|
||
Just a note for option 1, these commands will help you find all functions from calUtils.js
# Generate the patterns:
grep -o '^function [^(]\+(' ~/mozilla/comm-central/calendar/base/src/calUtils.js | sed -e 's/^function /[^\\.]/' > cufunc
# Use the pattern file to search files for unprefixed functions:
grep -nf cufunc path/to/file.js
Comment 6•12 years ago
|
||
Just for reference, here is the (untested) band-aid patch I had in my queue. Still not the best option though.
Assignee | ||
Comment 7•12 years ago
|
||
Isn't it so that we need both steps anyway?
If we switch to the .jsm, the rest of the code will have to switch some time anyway.
Else we will have both versions in the repo forever.
Or do I miss something?
Comment 8•12 years ago
|
||
Comment on attachment 788009 [details] [diff] [review]
Patch V1
I spoke with Markus and we've come to the conclusion that this band-aid might not be the best solution (dialog loads js, js loads jsm, jsm loads js, js tries to load jsm but stops because its already loaded), but its the safest band-aid for Lightning 2.6.
Markus agreed to look into converting a few of the jsm functions, we've set this aside for 2.7 or later though.
I'm going to push this now so we can build the beta.
Attachment #788009 -
Flags: review-
Attachment #788009 -
Flags: review+
Attachment #788009 -
Flags: approval-calendar-beta+
Attachment #788009 -
Flags: approval-calendar-aurora+
Comment 9•12 years ago
|
||
Comment on attachment 788009 [details] [diff] [review]
Patch V1
https://hg.mozilla.org/comm-central/rev/51b935acd4c5
https://hg.mozilla.org/releases/comm-aurora/rev/7d12206a4014
https://hg.mozilla.org/releases/comm-beta/rev/c09c6cbc8e1e
Attachment #788009 -
Flags: checkin+
Updated•12 years ago
|
Hardware: x86 → All
Target Milestone: --- → 2.6
Assignee | ||
Comment 10•12 years ago
|
||
I tested this patch and it fixes the dialog.
I also checked that the other dialogs using calUtils.js are working and not throwing any exceptions.
So this should enable us to remove the hack introduced to fix beta.
The next steps as laid out in comment 4 will be dealt with in bug 906107 and bug 905097
Attachment #788097 -
Attachment is obsolete: true
Attachment #791736 -
Flags: review?(philipp)
Updated•12 years ago
|
Keywords: regression
Comment 11•12 years ago
|
||
Comment on attachment 791736 [details] [diff] [review]
Bandaid Patch V1.1
r=philipp, sorry for the delay.
Attachment #791736 -
Flags: review?(philipp) → review+
Assignee | ||
Comment 12•12 years ago
|
||
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/9511d25881e9>
-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: 2.6 → 2.9
Comment 13•12 years ago
|
||
Nit: This was checked-in after the merge, i.e. for 3.0 and not 2.9. We should update this once the new target milestone is available.
Updated•12 years ago
|
Target Milestone: 2.9 → 3.0
Comment 14•11 years ago
|
||
I have no chlue whether this is the correct bug, but upgrading from icedove 17 to 24 just broke my Calendar:
I have multiple Errors like this:
Timestamp: 22/03/14 23:29:15
Error: TypeError: Components.classes[cid] is undefined
Source File: resource://calendar/modules/calUtils.jsm -> file:///home/USERNAME/.icedove/masso6vj.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/calendar-js/calUtils.js
Line: 22
whick refers to this lines of Code:
/* HACK: Loading calUtils.jsm here is a hack and should be fixed asap. If you
* see this here after Lightning 2.6, please drop everything and make it go
* away. See bug 902916 for details.
*/
Components.utils.import("resource://calendar/modules/calUtils.jsm");
function _calIcalCreator(cid, iid) {
return function(icalString) {
let thing = Components.classes[cid].createInstance(iid);
if (icalString) {
thing.icalString = icalString;
}
return thing;
};
}
So how do I make it go away?
You need to log in
before you can comment on or make changes to this bug.
Description
•