Closed Bug 183396 Opened 22 years ago Closed 17 years ago

Disallow users to add events/tasks after deleting the last calendar

Categories

(Calendar :: General, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: kenny, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130

If you try to add a event with no calendars defined, mozilla will crash - all of
mozilla that is, not just the calendar.

Reproducible: Always

Steps to Reproduce:
1. Delete all calendars out of the mozilla calendar.
2. Add an event (or try to).

Actual Results:  
Mozilla crashes and burns.  The following error is will show up when I ran from
the command line:

icalerror.c:57: FILE: An operation on a file failed. Check errno for more detail.
mozilla-bin: icalerror.c:58: icalerror_set_errno: Assertion `0' failed.

Expected Results:  
In case of trying to add an event to a non-existant calendar, mozilla should
probably prompt you to create a calendar, not crash.

I have only tested this with Mozilla 1.2.1 and the latest calendar on Slackware
Linux 1.2.1.

I am filing this as a normal bug and not a critical bug despite it causing
Mozilla to crash since this is a situation that probably will not happen very often.
Does not works for me on WinME with Mozilla/5.0 (Windows; U; Win 9x 4.90; cs-CZ;
rv:1.2.1) Gecko/20021130
Severity: normal → trivial
For me, the event doesn't get added at all, which is expected.
If you've removed all your calendars, it doesn't know where to put the calendar
event.  We should probably disable the ability to remove your root calendar.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: calendar crashes when adding event with no calendars defined → Disallow users to delete main calendar
-> Me
Assignee: gray → mikep
Component: libical → Calendar General
New contact from mikep@oeone.com to mostafah@oeone.com
Filter on string OttawaMBA to get rid of these messages. 
Sorry for the spam.
Assignee: mikep → mostafah
*** Bug 273343 has been marked as a duplicate of this bug. ***
QA Contact: gurganbl → general
Attached patch disable new event/task commands — — Splinter Review
Patch disables the new event/task commands when there are no calendars.  This seems like a better option than actually forbiding the user from deleting a calendar he may not want.  It's still an edge case, anyway, since we always create a calendar on startup if there isn't one.
Assignee: mostafah → jminta
Status: NEW → ASSIGNED
Attachment #218828 - Flags: first-review?(mvl)
Comment on attachment 218828 [details] [diff] [review]
disable new event/task commands

>Index: resources/content/calendarManagement.js
>     onCalendarUnregistering: function(aCalendar) {
>+            if (getCalendarManager().getCalendars({}).length <= 1) {

I'm not sure when this function is called, but is length==1 really a case where you want to disable the options? If so, please add a comment explaining it. (the function might be called before or after the unregistration, i don't know)

r=mvl with that comment, or the check fixed.
Attachment #218828 - Flags: first-review?(mvl) → first-review+
(In reply to comment #7)
> (From update of attachment 218828 [details] [diff] [review] [edit])
> >Index: resources/content/calendarManagement.js
> >     onCalendarUnregistering: function(aCalendar) {
> >+            if (getCalendarManager().getCalendars({}).length <= 1) {
> 
> I'm not sure when this function is called, but is length==1 really a case where
> you want to disable the options? If so, please add a comment explaining it.
> (the function might be called before or after the unregistration, i don't know)
It's called before the calendar is actually deleted, so yes, we want to disable on ==1.

Whiteboard: [needs landing]
patch checked in on trunk and MOZILLA_1_8_BRANCH
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Summary: Disallow users to delete main calendar → Disallow users to add events/tasks after deleting the last calendar
Whiteboard: [needs landing]
With this patch the menu commands are disabled but double click in calendar view or task list still works. The displayed dialog throws an error because no calendar is available and Sunbird needs to be restarted. Not sure if we want a fix for that edge cases too.
Reopening since the fix is incomplete.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
*** Bug 348555 has been marked as a duplicate of this bug. ***
Re-assigning my bugs to nobody@mozilla.org due to recent developments.
Assignee: jminta → nobody
Status: REOPENED → NEW
With the changes from Bug 394025 it's no longer possible to delete the last calendar. Therefore the issue from Comment #10 doesn't exists anymore. In my opinion we can close this bug now.
OS: Linux → All
Hardware: PC → All
Whiteboard: [qa discussion needed]
QA Chat agrees.

INVALID, since its now not possible to delete the last calendar, so no point in disallowing users to add events/tasks.
Status: NEW → RESOLVED
Closed: 19 years ago17 years ago
Resolution: --- → INVALID
Whiteboard: [qa discussion needed]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: