From ee57f38e491401bae04b6a3c582b70a2523ce8cb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 4 Feb 2010 01:48:00 +0000 Subject: [PATCH] - Fix "ItemID not set for object before attempting to load data" conflict resolution error - Probably fix "getFileName() can only be called on attachment items in Zotero.Item.getFilename()" conflict resolution error --- chrome/content/zotero/bindings/merge.xml | 2 +- chrome/content/zotero/xpcom/data/item.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/bindings/merge.xml b/chrome/content/zotero/bindings/merge.xml index 92eb08290..69a32cda1 100644 --- a/chrome/content/zotero/bindings/merge.xml +++ b/chrome/content/zotero/bindings/merge.xml @@ -92,7 +92,7 @@ // TODO: Make sure object is the correct type // Check for note or attachment if not already set - if (this._leftpane.ref == 'deleted' && this.type == 'item') { + if (this._leftpane.ref == 'deleted' && val instanceof Zotero.Item) { this.type = this._getTypeFromItem(val); } diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index ebfb31199..47666c020 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -3667,6 +3667,7 @@ Zotero.Item.prototype.clone = function(includePrimary, newItem, unsaved) { Zotero.DB.beginTransaction(); + // TODO: get rid of serialize() call var obj = this.serialize(); var itemTypeID = this.itemTypeID; @@ -4146,7 +4147,7 @@ Zotero.Item.prototype.serialize = function(mode) { if (!this._primaryDataLoaded) { this.loadPrimaryData(true); } - if (!this._itemDataLoaded) { + if (!this._itemDataLoaded && this.id) { this._loadItemData(); } }