Closed Bug 392388 Opened 17 years ago Closed 17 years ago

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

Categories

(Calendar :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ssitter, Assigned: Fallen)

References

Details

Attachments

(1 file)

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
Attached patch Fix pref observer — — Splinter Review
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+
Checked in on HEAD and MOZILLA_1_8_BRANCH

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.7
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
Blocks: 388405
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.

Attachment

General

Created:
Updated:
Size: