From a342cb3546ee4777e9457eb385137e63e87f4890 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 17 Feb 2011 04:06:18 +0000 Subject: [PATCH] Always favor PDF attachments over non-PDF attachments --- chrome/content/zotero/xpcom/data/item.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index c18c547bf..67a7af302 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -3279,8 +3279,8 @@ Zotero.Item.prototype.getBestAttachment = function() { /* * Looks for attachment in the following order: oldest PDF attachment matching parent URL, - * oldest non-PDF attachment matching parent URL, oldest PDF attachment not matching URL, - * old non-PDF attachment not matching URL + * oldest PDF attachment not matching parent URL, oldest non-PDF attachment matching parent URL, + * old non-PDF attachment not matching parent URL * * @return {Array} itemIDs for attachments */ @@ -3296,7 +3296,7 @@ Zotero.Item.prototype.getBestAttachments = function() { + "LEFT JOIN itemDataValues IDV ON (ID.valueID=IDV.valueID) " + "WHERE sourceItemID=? AND linkMode NOT IN (?) " + "AND IA.itemID NOT IN (SELECT itemID FROM deletedItems) " - + "ORDER BY value=? DESC, mimeType='application/pdf' DESC, dateAdded ASC"; + + "ORDER BY mimeType='application/pdf' DESC, value=? DESC, dateAdded ASC"; return Zotero.DB.columnQuery(sql, [this.id, Zotero.Attachments.LINK_MODE_LINKED_URL, url]); }