diff --git a/chrome/content/zotero/preferences/preferences_advanced.js b/chrome/content/zotero/preferences/preferences_advanced.js index 0eab089f58..3531df6e28 100644 --- a/chrome/content/zotero/preferences/preferences_advanced.js +++ b/chrome/content/zotero/preferences/preferences_advanced.js @@ -593,7 +593,7 @@ Zotero_Preferences.Attachment_Base_Directory = { }, - changePath: Zotero.Promise.coroutine(function* (basePath) { + changePath: async function (basePath) { Zotero.debug(`New base directory is ${basePath}`); if (Zotero.File.directoryContains(Zotero.DataDirectory.dir, basePath)) { @@ -605,38 +605,37 @@ Zotero_Preferences.Attachment_Base_Directory = { ); } - // Find all current attachments with relative attachment paths - var sql = "SELECT itemID FROM itemAttachments WHERE linkMode=? AND path LIKE ?"; - var params = [ - Zotero.Attachments.LINK_MODE_LINKED_FILE, - Zotero.Attachments.BASE_PATH_PLACEHOLDER + "%" - ]; - var oldRelativeAttachmentIDs = yield Zotero.DB.columnQueryAsync(sql, params); - - //Find all attachments on the new base path + // Find all attachments on the new base path var sql = "SELECT itemID FROM itemAttachments WHERE linkMode=?"; var params = [Zotero.Attachments.LINK_MODE_LINKED_FILE]; - var allAttachments = yield Zotero.DB.columnQueryAsync(sql, params); + var allAttachments = await Zotero.DB.columnQueryAsync(sql, params); var newAttachmentPaths = {}; var numNewAttachments = 0; var numOldAttachments = 0; - for (let i=0; i