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)

Lightning 2.6
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Taraman, Assigned: Taraman)

References

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

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.
This is caused by rev b532ed24389a Don't know why yet. [1]: http://hg.mozilla.org/comm-central/rev/b532ed24389a
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
Summary: calendar-occurrence-prompt is not initialized correctly → calendar-occurrence-prompt is not initialized correctly [Error: 'ReferenceError: cal is not defined' in calUtils.js]
Attached patch Patch V1 β€” β€” Splinter Review
Thanks Stefan, that was a goog clue - I didn't get this error message for some reason. Now cal is defined in calUtils.js
Assignee: nobody → Mozilla
Status: NEW → ASSIGNED
Attachment #788009 - Flags: review?(philipp)
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-
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
Attached patch Band-aid patch v1 (obsolete) β€” β€” Splinter Review
Just for reference, here is the (untested) band-aid patch I had in my queue. Still not the best option though.
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 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+
Hardware: x86 → All
Target Milestone: --- → 2.6
Blocks: 905097
Attached patch Bandaid Patch V1.1 β€” β€” Splinter Review
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)
Keywords: regression
Blocks: 922777
Comment on attachment 791736 [details] [diff] [review] Bandaid Patch V1.1 r=philipp, sorry for the delay.
Attachment #791736 - Flags: review?(philipp) → review+
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
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.
Target Milestone: 2.9 → 3.0
No longer blocks: 922777
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.

Attachment

General

Created:
Updated:
Size: