www

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

commit 44fd5986992cfe5178b3bb70ff7883aeaec93aaa
parent a714f0667045207cef8ff0facc0f7b0c186b6326
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 20 Feb 2018 03:33:00 -0500

Load creators if needed to update display title in Items._loadItemData()

Diffstat:
Mchrome/content/zotero/xpcom/data/items.js | 16+++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/data/items.js b/chrome/content/zotero/xpcom/data/items.js @@ -315,7 +315,21 @@ Zotero.Items = function() { item._clearChanged('itemData'); // Display titles - item.updateDisplayTitle() + try { + item.updateDisplayTitle() + } + catch (e) { + // A few item types need creators to be loaded. Instead of making + // updateDisplayTitle() async and loading conditionally, just catch the error + // and load on demand + if (e instanceof Zotero.Exception.UnloadedDataException) { + yield item.loadDataType('creators'); + item.updateDisplayTitle() + } + else { + throw e; + } + } } });