commit a24200b30c2ca21c60d1d8d3a90dbbe6b05052f0
parent d951bab1be689313eeb4ea3382863bbffe0e2045
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 30 Oct 2008 19:57:51 +0000
Imported snapshot path wasn't being set properly
Diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js
@@ -141,19 +141,17 @@ Zotero.Attachments = new function(){
// translate.js, which sets the metadata fields itself
var itemID = attachmentItem.save();
attachmentItem = Zotero.Items.get(itemID)
- var attachmentKey = attachmentItem.key;
+
+ var newFile = this.getStorageDirectory(itemID);
+ var newName = newFile.leafName;
var storageDir = Zotero.getStorageDirectory();
- file.parent.copyTo(storageDir, attachmentKey);
+ file.parent.copyTo(storageDir, newName);
// Point to copied file
- var newFile = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- newFile.initWithFile(storageDir);
- newFile.append(attachmentKey);
newFile.append(file.leafName);
- attachmentItem.path = this.getPath(newFile, this.LINK_MODE_IMPORTED_URL);
+ attachmentItem.attachmentPath = this.getPath(newFile, this.LINK_MODE_IMPORTED_URL);
attachmentItem.save();
Zotero.DB.commitTransaction();