From 5ec339c9df57d4fe348649e6e251be4df67d17c1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 31 May 2009 05:57:43 +0000 Subject: [PATCH] Fix group collection sort --- chrome/content/zotero/xpcom/data/group.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/group.js b/chrome/content/zotero/xpcom/data/group.js index c1e88ea99..a46434563 100644 --- a/chrome/content/zotero/xpcom/data/group.js +++ b/chrome/content/zotero/xpcom/data/group.js @@ -186,7 +186,6 @@ Zotero.Group.prototype.getCollections = function (parent) { var sql = "SELECT collectionID FROM collections WHERE libraryID=? AND " + "parentCollectionID " + (parent ? '=' + parent : 'IS NULL'); var ids = Zotero.DB.columnQuery(sql, this.libraryID); - Zotero.debug(ids); // Return Zotero.Collection objects var objs = []; @@ -194,6 +193,13 @@ Zotero.Group.prototype.getCollections = function (parent) { var col = Zotero.Collections.get(id); objs.push(col); } + + // Do proper collation sort + var collation = Zotero.getLocaleCollation(); + objs.sort(function (a, b) { + return collation.compareString(1, a.name, b.name); + }); + return objs; }