Closed Bug 293788 Opened 20 years ago Closed 20 years ago

General preferences (calendarPref.xul) not stored/preserved

Categories

(Calendar :: Preferences, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jminta, Assigned: jminta)

Details

(Keywords: regression)

Attachments

(1 file)

The patch for bug 268084 introduced a regression into Sunbird.  After entering
or deleting a category, the category preferences string is not saved.  The
hidden textbox is properly updated, but the data in the prefstring is not
preserved.  The patch for bug 268084 only seems to introduce this regression in
Sunbird.  Applying the patch to .xpi builds of calendar for firefox does not
create the regression.

(Deleting a category does not work on any build due to a minor typo.  The fix
for this will be included in the patch for the above issue.)
Actually, none of the normal preferences in calendarPref.xul are preserved. 
Preferences on other pages are preserved, though.
I've isolated the problem to calendarPref.xul line 106.  Anyone who needs these
preferences to work should comment out that call (registerCancelCallbackFunc)
and things will return to normal.  I suspect the issue is due to some subtle
difference between pref.xul and prefBird.xul.  I'm working to try and track that
down.

(updating summary)
Summary: Category preferences broken → General preferences (calendarPref.xul) not stored/preserved
(In reply to comment #0)
> Applying the patch to .xpi builds of calendar for firefox does not
> create the regression.

It doesn't work for me on seamonkey with --enable-calendar
Attached patch Tidy things up — — Splinter Review
(In reply to comment #3)
> It doesn't work for me on seamonkey with --enable-calendar

That makes sense, since seamonkeys don't fly.

The specific problem was that pref.xul and prefBird.xul don't agree on what to
call their preference services object.	This patch changes the name of
prefBird.xul's pref services object.

For the preferences window, Sunbird and Seamonkey use pref.xul.  Firefox and
Thunderbird use prefBird.xul.  Any build using pref.xul would exhibit this
regression.  In this respect prefBird and Sunbird have a naming clash.	I'd
like to at least include some documentation to clarify this, but there are no
license headers (and hence no 'Notes' section).  I also couldn't figure out who
the original authors of these files were, and didn't want to include the
headers without that.  Tell me who to give credit to and I'll add those in.

Note: In tracking this down, I also found that prefBird.xul's services are
slightly more robust than nsPrefWindow.js because prefBird.xul encloses all
registered cancelFunc's in try/catch.  Whether this hides errors that should be
found or saves programs from crashing is up for debate, but perhaps one of them
should change.

In addition, this patch tidies a few things up:
-Move repeated try/catch for backing up data to the actual backupData function
for efficiency.
-Fix typo in panelOnCancel
-Fix typo in deleteCategory
-remove extra gCategoryList.sort() calls.

I threw every test I could think of at this and it passed most of them. 
Remaining issues are:
-sort() sorts by char value, meaning "ZZZ" comes before "aaa".	I can work
around this with a manual sort, but it will be a bit slow. See also bug 278799.

-Superlong category names are a problem for this new setup.  I'd like to fix
this in the patch for bug 258555.
Attachment #183400 - Flags: first-review?(mvl)
While we're on the subject of tidying this up, should something be done about
bug 273394 which asks for wider borders to better display the color?
Attachment #183400 - Flags: first-review?(mvl) → first-review+
patch checked in.
Other issues can be handled in other bugs. And bug 273394 isn't about the prefs,
but about the display, so i see no reason to handle it here.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: gurganbl → sunbird
Component: Sunbird Only → Preferences
QA Contact: sunbird → preferences
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: