Cannot change attachment linkMode

D124941415
I have disabled all plugins, but the error *Cannot change attachment linkMode* still persists when syncing. I use Nutstore WebDAV for PDF attachment sync. Could you please advise on the next steps?
Thanks very much!
  • dstillman Zotero Team
    Some plugin you used converted imported_url attachments to imported_file attachments. You'll need to figure out what did that and notify the developer.

    This should fix it in Tools → Developer → Run JavaScript, but we can't help if not:

    let libraryID = Zotero.Libraries.userLibraryID;
    let ids = await Zotero.DB.columnQueryAsync(
    "SELECT itemID FROM items JOIN itemAttachments USING (itemID) "
    + "WHERE libraryID=? AND synced=0 AND linkMode=?",
    [libraryID, Zotero.Attachments.LINK_MODE_IMPORTED_FILE]
    );
    let fixed = [];
    for (let item of await Zotero.Items.getAsync(ids)) {
    let cached = await Zotero.Sync.Data.Local.getCacheObject('item', libraryID, item.key, item.version);
    if (cached && cached.data.linkMode == 'imported_url') {
    item.attachmentLinkMode = Zotero.Attachments.LINK_MODE_IMPORTED_URL;
    await item.saveTx({ skipDateModifiedUpdate: true });
    fixed.push(item.key);
    }
    }
    return fixed;

Sign In or Register to comment.