diff --git a/chrome/content/zotero/elements/attachmentBox.js b/chrome/content/zotero/elements/attachmentBox.js index adfe4cbbe6..126a135022 100644 --- a/chrome/content/zotero/elements/attachmentBox.js +++ b/chrome/content/zotero/elements/attachmentBox.js @@ -259,7 +259,7 @@ let indexStatusRow = this._id('indexStatusRow'); let selectButton = this._id('select-button'); - let fileExists = await IOUtils.exists(this._item.getFilePath()); + let fileExists = this._item.isFileAttachment() && await this._item.fileExists(); let isImportedURL = this.item.attachmentLinkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL; let isLinkedURL = this.item.attachmentLinkMode == Zotero.Attachments.LINK_MODE_LINKED_URL; @@ -287,7 +287,7 @@ } // Access date - if (this.displayAccessed && isImportedURL) { + if (this.displayAccessed && (isImportedURL || isLinkedURL)) { let itemAccessDate = this.item.getField('accessDate'); if (itemAccessDate) { itemAccessDate = Zotero.Date.sqlToDate(itemAccessDate, true); diff --git a/chrome/content/zotero/elements/attachmentPreview.js b/chrome/content/zotero/elements/attachmentPreview.js index c8f2cc8d38..71a8360d2e 100644 --- a/chrome/content/zotero/elements/attachmentPreview.js +++ b/chrome/content/zotero/elements/attachmentPreview.js @@ -98,7 +98,7 @@ } set item(val) { - this._item = (val instanceof Zotero.Item && val.isAttachment()) ? val : null; + this._item = (val instanceof Zotero.Item && val.isFileAttachment()) ? val : null; if (this.isVisible) { this.render(); } @@ -200,7 +200,7 @@ } this._renderingItemID = itemID; let success = false; - if (this.isValidType && await IOUtils.exists(this._item.getFilePath())) { + if (this.isValidType && await this._item.fileExists()) { if (this.isReaderType) { success = await this._renderReader(); }