From c5f01bc2f3ff593aa06345e32e47ce325a531660 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 15 Sep 2020 01:12:56 -0400 Subject: [PATCH] Make sure item returned from getLinkedItem() has all data loaded Follow-up to 8fc316f727 --- chrome/content/zotero/xpcom/data/item.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index f8ed26c1d9..165dd06fc6 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -4778,8 +4778,12 @@ Zotero.Item.prototype.migrateExtraFields = function () { * * @return {Promise} */ -Zotero.Item.prototype.getLinkedItem = function (libraryID, bidirectional) { - return this._getLinkedObject(libraryID, bidirectional); +Zotero.Item.prototype.getLinkedItem = async function (libraryID, bidirectional) { + var item = await this._getLinkedObject(libraryID, bidirectional); + if (item) { + await item.loadAllData(); + } + return item; };