Changing date format or timezone preference causes error in calendar-management.js

VERIFIED FIXED in 0.7

Status

Calendar
General
VERIFIED FIXED
10 years ago
10 years ago

People

(Reporter: Stefan Sitter, Assigned: Fallen)

Tracking

Details

Attachments

(1 attachment)

3.46 KB, patch
Michael Büttner (no reviews TFN)
: review+
Details | Diff | Splinter Review
(Reporter)

Description

10 years ago
Changing date format or timezone preference causes error using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.7pre) Gecko/20070815 Calendar/0.7pre

Steps to Reproduce:
1. Start Sunbird with clean profile
2. Open preference dialog
2. Change date format or timezone preference and save it

Actual Results:
Errors shown in Error Console:

  Error: currentView is not a function
  Source File: chrome://calendar/content/calendar-management.js  Line: 615

  Error: currentView is not a function
  Source File: chrome://calendar/content/calendar-management.js Line: 624

Expected Results:
No errors.

Additional Information:
Works in Sunbird 0.7pre (2007081406)
Fails in Sunbird 0.7pre (2007081506)
-> Regression from Bug 388405
(Assignee)

Comment 1

10 years ago
Created attachment 276912 [details] [diff] [review]
Fix pref observer

Based on mickeys comments in bug 388405, I now see what I did wrong. I think js should show strict warnings for such things ;)

There were a couple of problems actually. The mStartDate error has to do with the view not being initialized. It works fine when you click on calendar mode once then go back. This is actually something that might cause more problems in the future. Then there were two functions that were sunbird specific since we dont have the unifinder or unifinderToDo in lightning (yet). 

We should open a new bug to prevent problems with setting stuff from the view when it hasn't been initialized. This means we need to either initialize the view when methods/properties like selectedDay are called or otherwise notify the caller that the view has not been initialized.

I hope this fixes the issues.
Assignee: nobody → philipp
Status: NEW → ASSIGNED
Attachment #276912 - Flags: review?(michael.buettner)
Comment on attachment 276912 [details] [diff] [review]
Fix pref observer

>+                if (isSunbird()) {
>+                    refreshEventTree();
>+                    toDoUnifinderRefresh();
>+                }
I'm wondering why we need to call refreshEventTree() and toDoUnifinderRefresh(). Wouldn't it be better if these controls listens for changes by themselves and do whatever is necessary to keep on track? Admittedly, this is probably out of scope of this patch. Feel free to file a new bug or at least leave a comment that this should be fixed. Apart from that, the patch works as advertised. r=mickey.
Attachment #276912 - Flags: review?(michael.buettner) → review+
(Assignee)

Comment 3

10 years ago
Checked in on HEAD and MOZILLA_1_8_BRANCH

-> FIXED
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.7
(Reporter)

Comment 4

10 years ago
Verified using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.7pre) Gecko/20070817 Calendar/0.7pre.

Verified using Lightning 0.7pre (2007081705) with Thunderbird 2.0.0.7pre (20070817) on Windows 2000.
Status: RESOLVED → VERIFIED
(Reporter)

Updated

10 years ago
Blocks: 388405

Comment 5

10 years ago
Verified on linux with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.7pre) Gecko/20070906 Calendar/0.7pre
You need to log in before you can comment on or make changes to this bug.