Sync fails after deleting local files [added a quick/dirty fix]

I'm having troubles syncing with Zotero after deleting some local files (Report ID: 1062663103).

Zotero version is 2.0b7.6. When I start syncing a "Conflict Resolution" windows pops up (never saw that before - is it a new feature or an actual problem with my sync status?). It reports 29 conflicts.

The window shows local object (deleted), remote object, and merged object (which defaults to the remote object). I select the deleted object (the merged object becomes "deleted") then Next. After 8 or 9 such screens the window closes and a red icon appears near the sync icon. The message is

"ItemID not set for object before attempting to load data".

I tried to restart firefox but the problem persists.

Additional info: before syncing I deleted the files from the trash as well. My attachments (mostly pdf) are stored on a separate webdav server. I'm used to sync among two computers.
  • Just in case, I submitted a debug report with ID D872964030
  • Here is a quick, dirty fix (works for me).

    First, in merge.xml I changed

    if (this._leftpane.ref == 'deleted' && this.type == 'item') {
    into

    if (this._leftpane.ref == 'deleted') {
    The reason for this change is that I deleted some attachments and notes, but the conflict resolution wizard would not see the change of type and would throw an exception looking for a filename. I think this change would fix http://forums.zotero.org/discussion/10411/sync-error/ as well.

    Second, I changed item.js so that, when a note is deleted locally, serialize() would not try to load the note from the db. This is the "dirty" part since I don't know of any side-effects.

    Here is how it looks like:

    Zotero.Item.prototype.serialize = function(mode) {
    if (this.id || this.key) {
    if (!this._primaryDataLoaded) {
    this.loadPrimaryData(true);
    }
    if (this.isNote() && !this.id) {
    this._itemDataLoaded = true;
    }
    if (!this._itemDataLoaded) {
    this._loadItemData();
    }
    }
    ...
  • Thanks (and nice job debugging). We've made similar changes in 2.0rc3.
Sign In or Register to comment.