Bug 554220: Persona Editor - not closing or applying custom Persona in Firefox 3.6.2 client-1.6 client-release-1.6rc4
authorJose E. Bolanos <jose@appcoast.com>
Mon, 16 Aug 2010 16:10:25 -0600
branchclient-1.6
changeset 1334 0e4c23ac4adbc9fdf25288b3189e27be1b886415
parent 1332 719d5de0f52584d874404eb41e71aa3eb58524cc
child 1335 7b517aab28efa08beedd961667c8cda64bfc5438
push id857
push userjose@glaxstar.com
push dateMon, 16 Aug 2010 23:32:32 +0000
bugs554220
Bug 554220: Persona Editor - not closing or applying custom Persona in Firefox 3.6.2
client/modules/service.js
--- a/client/modules/service.js
+++ b/client/modules/service.js
@@ -676,16 +676,23 @@ let PersonaService = {
       this.currentPersona = this._getRandomPersonaFromArray(this.favorites);
       this.selected = "randomFavorite";
       this._prefs.set("persona.lastChanged", new Date().getTime().toString());
       this._notifyPersonaChanged(this.currentPersona);
     }
   },
 
   changeToPersona: function(persona) {
+    // The id must be a string and not an integer in order for the
+    // LightweightThemeManager to accept the persona. Older versions used to
+    // set a zero to the id of custom personas; if so, it needs to be changed
+    // to a "1". See: https://bugzilla.mozilla.org/show_bug.cgi?id=554220
+    if (persona.custom && persona.id === 0)
+      persona.id = "1";
+
     // Check whether the persona is in the favorites or the recent lists,
     // in which case the change-notification should not be shown.
     let recent = this.getRecentPersonas();
     let favorites = this.favorites;
     let inRecent =
       (recent && recent.some(function(v) v.id == persona.id));
     let inFavorites =
       (favorites && favorites.some(function(v) v.id == persona.id));