www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 1fad45da6322b35111d58f6be8ebb8db3473c314
parent 5b3a3a1ad2a901ff79c9d836a952c0e9d12d7f2c
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 15 Oct 2008 06:27:52 +0000

Fix erroneous caching of attachment path after relinking


Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -2279,16 +2279,14 @@ Zotero.Item.prototype.renameAttachmentFile = function(newName, overwrite) { Zotero.Item.prototype.relinkAttachmentFile = function(file) { - var linkMode = this.getAttachmentLinkMode(); - + var linkMode = this.attachmentLinkMode; if (linkMode == Zotero.Attachments.LINK_MODE_LINKED_URL) { throw('Cannot relink linked URL in Zotero.Items.relinkAttachmentFile()'); } var path = Zotero.Attachments.getPath(file, linkMode); - - var sql = "UPDATE itemAttachments SET path=? WHERE itemID=?"; - Zotero.DB.query(sql, [path, this.id]); + this.attachmentPath = path; + this.save(); }