diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 88b49e9ab..2a6a0f847 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -418,7 +418,16 @@ var Zotero_QuickFormat = new function () { // Search results might be in an unloaded library, so get items asynchronously and load // necessary data var items = yield Zotero.Items.getAsync(searchResultIDs); - yield Zotero.Items.loadDataTypes(items, ['itemData', 'creators']); + yield Zotero.Items.loadDataTypes(items); + // Load child items of search matches + // TODO: exclude child items from itemToExportFormat() so this isn't necessary? + for (let item of items) { + let ids = item.getAttachments().concat(item.getNotes()); + if (ids.length) { + let childItems = yield Zotero.Items.getAsync(ids); + yield Zotero.Items.loadDataTypes(childItems) + } + } searchString = searchString.toLowerCase(); var collation = Zotero.getLocaleCollation(); diff --git a/chrome/content/zotero/xpcom/data/dataObjects.js b/chrome/content/zotero/xpcom/data/dataObjects.js index 626cb3e4f..5c1fbf176 100644 --- a/chrome/content/zotero/xpcom/data/dataObjects.js +++ b/chrome/content/zotero/xpcom/data/dataObjects.js @@ -393,10 +393,13 @@ Zotero.DataObjects.prototype.getObjectVersions = Zotero.Promise.coroutine(functi * results might include objects in libraries that haven't yet been loaded. * * @param {Zotero.DataObject[]} objects - * @param {String[]} dataTypes + * @param {String[]} [dataTypes] - Data types to load, defaulting to all types * @return {Promise} */ Zotero.DataObjects.prototype.loadDataTypes = Zotero.Promise.coroutine(function* (objects, dataTypes) { + if (!dataTypes) { + dataTypes = this.ObjectClass.prototype._dataTypes; + } for (let dataType of dataTypes) { let typeIDsByLibrary = {}; for (let obj of objects) {