diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 570ca6abad..0578175725 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -2939,10 +2939,8 @@ Zotero.Item.prototype.renameAttachmentFile = async function (newName, overwrite /** * @param {string} path File path - * @param {Boolean} [skipItemUpdate] Don't update attachment item mod time, so that item doesn't - * sync. Used when a file needs to be renamed to be accessible but the user doesn't have - * access to modify the attachment metadata. This also allows a save when the library is - * read-only. + * @param {Boolean} [skipItemUpdate] Don't mark item as unsynced. Used when a file needs to be + * renamed to be accessible but the user doesn't have access to modify the attachment metadata. */ Zotero.Item.prototype.relinkAttachmentFile = async function (path, skipItemUpdate) { if (path instanceof Components.interfaces.nsIFile) { @@ -3028,7 +3026,7 @@ Zotero.Item.prototype.relinkAttachmentFile = async function (path, skipItemUpdat await this.saveTx({ skipDateModifiedUpdate: true, - skipClientDateModifiedUpdate: skipItemUpdate, + skipSyncedUpdate: skipItemUpdate, skipEditCheck: skipItemUpdate }); diff --git a/chrome/content/zotero/xpcom/storage/storageLocal.js b/chrome/content/zotero/xpcom/storage/storageLocal.js index 149d5c9a05..8fdac5aa04 100644 --- a/chrome/content/zotero/xpcom/storage/storageLocal.js +++ b/chrome/content/zotero/xpcom/storage/storageLocal.js @@ -598,16 +598,15 @@ Zotero.Sync.Storage.Local = { } // If newPath is set, the file was renamed, so set item filename to that - // and mark for updated + // and mark item for upload var path = await item.getFilePathAsync(); if (newPath && path != newPath) { - // If library isn't editable but filename was changed, update - // database without updating the item's mod time, which would result - // in a library access error + // If library isn't editable but filename was changed, update database without marking + // item as unsynced try { if (!Zotero.Items.isEditable(item)) { Zotero.debug("File renamed without library access -- " - + "updating itemAttachments path", 3); + + "updating attachment path", 3); await item.relinkAttachmentFile(newPath, true); } else {