Closed Bug 401720 Opened 13 years ago Closed 13 years ago

Cannot add event to calendar from invitation if I have multiple calendars

Categories

(Calendar :: E-mail based Scheduling (iTIP/iMIP), defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: agustin.louro, Assigned: jgrotepass)

References

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8
Build Identifier: Lightning 0.7 (build 2007102304)

After receiving an event invitation by e-mail and clicking on the Accept button, nothing appears to happen, but the following error is shown in the error console:

calGetString is not defined
chrome://lightning/content/imip-bar.js              Line: 294

Clicking on the Decline button gives the same result.

This only happens when I have multiple calendars loaded; it seems the problem arises when Lightning is trying to figure out which in calendar I want the event accepted or declined.

Reproducible: Always

Steps to Reproduce:
1. Load more than one calendar in Lightning.
2. Attempt to Accept or Decline an event invitation received by e-mail.
Actual Results:  
After receiving an event invitation by e-mail and clicking on the Accept button, nothing appears to happen, but the following error is shown in the error console:

calGetString is not defined
chrome://lightning/content/imip-bar.js              Line: 294

Clicking on the Decline button gives the same result.

Expected Results:  
If the Accept button is clicked, the event should be added to the calendar and an email compose window should open so I can tell the event organizer I have accepted.

If the Decline button is clicked, the event should not be added to the calendar and an email compose window should open so I can tell the event organizer I have declined.

The expected results should be the same as what happens if I only have one calendar loaded.
Works for me using Thunderbird 2.0.0.6 and Lightning 0.7

What Thunderbird version do you use? Can you attach the invitation (anonymized) as "eml" file? Does it work if you save the attached calendar and try to import it?
I use Thunderbird 2.0.0.6 (20070728).

It does work if I save the meeting.ics attachment and import it into Lightning.

How do I make the .eml file anonymous?

(In reply to comment #1)
> Works for me using Thunderbird 2.0.0.6 and Lightning 0.7
> 
> What Thunderbird version do you use? Can you attach the invitation (anonymized)
> as "eml" file? Does it work if you save the attached calendar and try to import
> it?
> 

(In reply to comment #2)
> I use Thunderbird 2.0.0.6 (20070728).
> 
> How do I make the .eml file anonymous?
> 
Just open it in a text editor and replace any information you dont want to have publicly available by random text (e.g. e-mail addresses).

This is a sample event invitation that causes the bug to manifest itself.
WFM using Lightning 0.7 and Tb 2.0.0.6. maybe you could try with new Tb profile? Maybe the other extensions cause a problem?
(In reply to comment #5)
> WFM using Lightning 0.7 and Tb 2.0.0.6. maybe you could try with new Tb
> profile? Maybe the other extensions cause a problem?
> 
I have tried with a new profile and no other extensions installed and I still get the same result.

What does WFM mean?
The Error: calGetString is not defined
Source file: chrome://lightning/content/imip-bar.js
Line: 294

can be recognized also with these installations
TB version 2.0.0.6 (20070728)
LG 0.7 (build 2007100109)  up to  LG 0.8pre (build 2007103004) 

Deleting all calendars to have just ONE gives normal op, will compose a reply msg.
Flags: wanted-calendar0.8+
only drivers can set a flag.
Flags: wanted-calendar0.8+ → wanted-calendar0.8?
Sorry!
But just do it, please!
People are using more than one calendar. And such a known issue should be addressed asap.
And it's part of what I said at other places: 'bundle' bugs to one main topic. This is "roundtrip of invitation request/reply".
(In reply to comment #6)
> 
> What does WFM mean?
> 
WFM == "works for me"

Anyone who is seeing this: we need detailed steps to reproduce. Could this depend on the type/number of calendars you are subscribed to? I still cannot reproduce this.
(In reply to comment #10)

> Anyone who is seeing this: we need detailed steps to reproduce. Could this
> depend on the type/number of calendars you are subscribed to? I still cannot
> reproduce this.
> 

I have tried it with two and three calendars and in both cases I get the same faulty result. I have also tried it with two calendars stored on my computer; and with one stored on my computer and one on a remote computer. I get the same faulty result in all cases.

I don't know what I am assuming that you are not. Do you have any ideas for other things to check?
(In reply to comment #8)
> only drivers can set a flag.
> 

What does this mean?
(In reply to comment #12)
> (In reply to comment #8)
> > only drivers can set a flag.
> > 
> 
> What does this mean?
> 
It means that users can only propose by setting flag to '?'. Only people who are responsible for releasing next version can accept it.
(In reply to comment #11)
> (In reply to comment #10)
> 
> > Anyone who is seeing this: we need detailed steps to reproduce. Could this
> > depend on the type/number of calendars you are subscribed to? I still cannot
> > reproduce this.
> > 
The error can be reproduced on my installation (XPhome all upd, TB2.0.0.6 with all different LG.xpi 0.7/0.8) allways. Adding a local calendar will produce the error, deleting all fine.

Maybe the same cause is the following situation producing this error sequence at once:

Error: showError is not defined
Source file: chrome://lightning/content/imip-bar.js
Line: 400
 ----------
Error: showError is not defined
Source file: chrome://lightning/content/imip-bar.js
Line: 400
 ----------
Error: showError is not defined
Source file: chrome://lightning/content/imip-bar.js
Line: 400
 ----------
Error: '[JavaScript Error: "showError is not defined" {file: "chrome://lightning/content/imip-bar.js" line: 400}]' when calling method: [calIOperationListener::onOperationComplete] = NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS
Source file: file:///D:/_Mozilla/TB_gW/Profiles/gW_Lightning/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/components/calStorageCalendar.js
Line: 419

This is generated with:
1. have just one calendar
2. open msg with invitation, shows [ACCEPT][DECLINE]
3. use any button, will send reply msg, change msg invitation line .... no error
4. close msg, reopen same msg ... same as 2.\
5. use any button, will not send reply msg, msg invitation bar is gone, produces above errors.

The imip-bar.js error msg holds "Invitation could not be processed. Status: 2152333316\nDetails: ID already exists for addItem"
.. so this seems to be right,
but it can't call the showError(msg) function!
The showError(msg) (part of import-export.js) also has the same call to 
calGetString("calendar", "errorTitle"),aMsg) generating the initial error description:

calGetString is not defined
chrome://lightning/content/imip-bar.js              Line: 294
I am having the same error. I do not have a local calendar, as all of mine are handled by Provider for Google Calendar (version 0.3.1).

Error: calGetString is not defined
Source File: chrome://lightning/content/imip-bar.js
Line: 294

Seems to me that if calGetString is not defined, it should open a dialog box to prompt for an acceptable value (e.g. the list of calendars).
I have the same issue.  Main cal is a local one.  If I try to add a webdav cal or even gmail, so long as I have > 1 cal I cannot accept or decline and receive the calGetString error.  

TB 2.0.0.9 (20071031)
Lightning 0.7 (build 2007102304)

I'm happy to help debug in any way I can.

Scott
Canceling wanted request for now. To fix this, we need clear steps to reproduce. Until those can be provided, there's nothing that the developers can do about this.
Flags: wanted-calendar0.8?
Hello Simon!

Does this mean, you cannot reproduce the error?

I have the same error here and did not have any special settings.
I'm using a DAViCal storage (CalDav-Server) with several calendars and it does
not work.

What further information do you need? What did you tried?
Well, here is another one running into this issue.
All Calendars are defined, like Svens, in DAViCal (formerly RSCDS).
Environment:
Mac OS X 10.4.11
Thunderbird: 2.0.0.9 (20071031)
Lightning: 0.7 - Build 2007100201)
Multiple Calendars (7 at this moment)

Steps to reproduce (at least here):
1. Create a new event with Lightning
2. Invite somebody in my organisation
3. Enter Email of person/resource
4. Check the box (free translated...) Send Invitation by email on Lightning Event Panel
5. Open Email with .ics attached
6. Line with Accept/Reject Button is visible
7. Click on either Accept/Reject Button
8. Nothing happens
9. Open Error Console
10. Error "calGetString is not defined in Line: 294 in chrome://lightning/content/imip-bar.js"

In Function "getTargetCalendar()" of this .js 
/**
 * Call the calendar picker
 */
function getTargetCalendar()
{
    var calendarToReturn;
    var calMgr = Components.classes["@mozilla.org/calendar/manager;1"]
                           .getService(Components.interfaces.calICalendarManager);
    var count = new Object();
    var calArray = calMgr.getCalendars(count);

    if (count.value == 1) {
        // There's only one calendar, so it's silly to ask what calendar
        // the user wants to import into.
        calendarToReturn = calArray[0];
    } else {
        // Ask what calendar to import into
        var args = new Object();
        var aCal;
        args.onOk = function selectCalendar(aCal) { calendarToReturn = aCal; };
        args.promptText = calGetString("calendar", "importPrompt");
        openDialog("chrome://calendar/content/chooseCalendarDialog.xul",
                   "_blank", "chrome,titlebar,modal,resizable", args);
    }
    return calendarToReturn;
}


--
So this is related to users with more than one calendar.
Maybe it is related to remote calendars (not verified)

Question:
Where is the function "calGetString" "normally" defined and why is this not in our installations (language depended?????)

Cheers
Jochen
Flags: blocking-calendar0.8?
Keywords: qawanted
OK, Starting to answer my own question...
calGetString is defined in calutils.js in the "js" subdirectory.
this throws the next question for the un-experienced-Mozilla Developer, how does the imip-bar.js which is inside the components directory refer to the calutils.js in the js directory?
I guess I need to get some basics on the call-flow of Mozilla/Thunderbird stuff.

Jochen
Well, this was a simple one ;-)
The issue is within the imip-bar-overlay.xul.
There is no reference to the calutil.js. Therefore the utils are not loaded and cannot be used.
I supply a patch for this. It worked for me.
I patched the xul and rebuild the "lightning.jar". 

Have a nice day,
Jochen
Thank you very much Jochen!
Just played with it a bit more. 
There are still issues with the "DECLINE" Function.
First, when clicking "DECLINE" the Script ask for a Calendar. This doesn't make sense. 
There is a patch in Bug 404023 which deals with that.
Next there is a Exception thrown withing callItipProcessor.js because there is no calendar selected. I am working on this right now.

Lets see what happens next.
Jochen
Jochen, when you have a patch thats ready for checkin, please see http://wiki.mozilla.org/Calendar:Module_Ownership for info from whom to request review from.
Comment on attachment 297545 [details] [diff] [review]
Patch to fix the "calGetString" Function undefined error in imip-bar

Fix only the undefined Function "calGetString" in imip-bar.js.
Attachment #297545 - Flags: review?(ctalbert)
Thanks Philipp. I should have read the Wiki better before filing a patch ;-)
Even if this bug is fixed, there are lots of other issues coming up after that. At least if someone (like me) is working with several identities/email Accounts/Distribution Lists.
I also started working on that....
Jochen
Status: UNCONFIRMED → NEW
Component: General → Lightning Only
Ever confirmed: true
Keywords: qawanted
OS: Windows XP → All
QA Contact: general → lightning
Hardware: PC → All
Comment on attachment 297545 [details] [diff] [review]
Patch to fix the "calGetString" Function undefined error in imip-bar

jgrotepass: Thanks for the patch!  

Why does this issue appear to be dependent on multiple calendars vs. one calendar? If this <script> tag were the true cause, I would expect that it would always fail, regardless of calendar configuration.

However, I think we should still take this patch, seeing as we use functions in calUtils.js inside the imip-bar.js.  

Wrt the patch, I have only one nit: please use the same spacing that the other <script> tags use so that they line up nicely.

Do you need me to check this in for you or do you have a CVS account?
Attachment #297545 - Flags: review?(ctalbert) → review+
Assignee: nobody → jgrotepass
Status: NEW → ASSIGNED
Clint,
the function getTargetCalendar checks, if there are more than one calendar, to present the selection window. If there is only 1 cal, the function "calGetString" is never called and therefore not used. If calutils.js is loaded earlier because of some other scripts, than this issue does not come up. In my tests, I opened only the invitation and tried to accept that. With this patch applied it works as expected. Thats my view (from a lightning beginner point of view).

Thanks for the hint with alignement. I haven't read the wiki and developer hints before applying the patch. Sorry for that ignorance ;-)

I am not aware on a CVS account (too many accounts around the world). Also I would like you to check that patch in. I don't like to make another "ignorant" mistake the first time providing fixes/patches to Lightning. At least comments etc might have a specific format that I haven't looked through (yet). 
I will create an CVS account (if not already there) and prepare myself for the next patch (still on process).

Thanks
Jochen
Flags: blocking-calendar0.8? → blocking-calendar0.8+
(In reply to comment #31)
> Clint,
> the function getTargetCalendar checks, if there are more than one calendar, to
> present the selection window. If there is only 1 cal, the function
> "calGetString" is never called and therefore not used. 
Doh.  I realized that, I think I was asking the wrong question.  I think I was trying to ask why we haven't seen this when testing with multiple calendars (which I do) and I still have never seen this.

> If calutils.js is loaded
> earlier because of some other scripts, than this issue does not come up. In my
> tests, I opened only the invitation and tried to accept that. With this patch
> applied it works as expected. 
And this I think just answered the real question I was actually trying to ask.  Thanks.

> Thanks for the hint with alignement. I haven't read the wiki and developer
> hints before applying the patch. Sorry for that ignorance ;-)
> 
> I am not aware on a CVS account (too many accounts around the world). Also I
> would like you to check that patch in. I don't like to make another "ignorant"
> mistake the first time providing fixes/patches to Lightning. At least comments
> etc might have a specific format that I haven't looked through (yet). 
> I will create an CVS account (if not already there) and prepare myself for the
> next patch (still on process).

No worries.  There is a very general hacking guidelines document here: http://www.mozilla.org/hacking/life-cycle.html.  One thing that you'll quickly notice is that Mozilla has in general moved to 2 space indenting on trunk.  We still use 4 space on the Calendar project, just use whatever the file you're changing uses.

CVS: We like for people to submit several patches before applying for a CVS account (which is an involved process - read about it here: http://www.mozilla.org/hacking/getting-cvs-write-access.html).  

So, don't worry about trying to do that yet.  Either myself of any of the other calendar dev's will be happy to check in your patches for you, just keep them coming. :-)

Thanks for the help.  There's no need for an updated path on this bug, I'll correct the indenting before checkin.
Flags: blocking-calendar0.8+ → blocking-calendar0.8?
Keywords: checkin-needed
Flags: blocking-calendar0.8? → blocking-calendar0.8+
Checked in on Branch and Trunk --> FIXED
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
For calendar code also see recommendations from <http://wiki.mozilla.org/Calendar:Style_Guide>.
Target Milestone: --- → 0.8
Verified with Lightning 2008012900
Status: RESOLVED → VERIFIED
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Lightning/0.8pre (2008012818) Thunderbird/2.0.0.9 ID:2007103104

VERIFIED
Duplicate of this bug: 414631
Component: Lightning Only → E-mail based Scheduling (iTIP/iMIP)
QA Contact: lightning → email-scheduling
You need to log in before you can comment on or make changes to this bug.