diff --git a/chrome/content/zotero/reportInterface.js b/chrome/content/zotero/reportInterface.js index 8f4fdba231..53ed6f066a 100644 --- a/chrome/content/zotero/reportInterface.js +++ b/chrome/content/zotero/reportInterface.js @@ -40,7 +40,7 @@ var Zotero_Report_Interface = new function() { var sortColumn = ZoteroPane_Local.getSortField(); var sortDirection = ZoteroPane_Local.getSortDirection(); if (sortColumn != 'title' || sortDirection != 'ascending') { - queryString = '?sort=' + sortColumn + (sortDirection != 'ascending' ? '' : '/d'); + queryString = '?sort=' + sortColumn + (sortDirection == 'ascending' ? '' : '/d'); } if (col) { diff --git a/components/zotero-protocol-handler.js b/components/zotero-protocol-handler.js index 38c7d656d0..366143b50d 100644 --- a/components/zotero-protocol-handler.js +++ b/components/zotero-protocol-handler.js @@ -424,6 +424,15 @@ function ChromeExtensionHandler() { valA = Zotero.Date.strToMultipart(a[sorts[index].field]); valB = Zotero.Date.strToMultipart(b[sorts[index].field]); } + // TEMP: This is an ugly hack to make creator sorting + // slightly less broken. To do this right, real creator + // sorting needs to be abstracted from itemTreeView.js. + else if (sorts[index].field == 'firstCreator') { + var itemA = Zotero.Items.getByLibraryAndKey(a.libraryID, a.key); + var itemB = Zotero.Items.getByLibraryAndKey(b.libraryID, b.key); + valA = itemA.getField('firstCreator'); + valB = itemB.getField('firstCreator'); + } else { valA = a[sorts[index].field]; valB = b[sorts[index].field];