mirror of
https://github.com/zotero/zotero.git
synced 2026-10-03 02:21:49 +00:00
Load attachment data when handling file renaming on item metadata change
File renaming has a Notifier handler for item modifications that needs best-attachment titles, but attachments and their item data might not be loaded even when parent items are. (This came up when migrating fields from Extra after a global schema update before the main window had loaded.)
This commit is contained in:
parent
bf9e5d3a83
commit
d6fc071139
2 changed files with 2 additions and 1 deletions
|
|
@ -285,6 +285,7 @@ export function registerAutoRenameFileFromParent() {
|
|||
}
|
||||
}
|
||||
|
||||
await attachmentItem.loadDataType('itemData');
|
||||
let previousMetadataBaseName = Zotero.Attachments.getFileBaseNameFromItem(
|
||||
parentItemBefore, { attachmentTitle: attachmentItem.getField('title') }
|
||||
);
|
||||
|
|
|
|||
|
|
@ -3921,7 +3921,7 @@ Zotero.Item.prototype.getBestAttachments = async function () {
|
|||
+ "AND IA.itemID NOT IN (SELECT itemID FROM deletedItems) "
|
||||
+ "ORDER BY contentType='application/pdf' DESC, value=? DESC, dateAdded ASC";
|
||||
var itemIDs = await Zotero.DB.columnQueryAsync(sql, [this.id, url]);
|
||||
return this.ObjectsClass.get(itemIDs);
|
||||
return await this.ObjectsClass.getAsync(itemIDs);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue