problems with Zotero.Item.addTag()

33 views
Skip to first unread message

Joscha

unread,
Jan 21, 2012, 3:51:51 AM1/21/12
to zotero-dev
Hi,

I have a problem with adding tags to items from the zotero API. A
zotfile user reported this problem but wasn't able to reproduce it
completely. So unfortunately, I can't tell you the exact steps that
lead to the error but I know that everything works fine for a couple
of items and stops working afterwords.
Here is the error message:

Error: uncaught exception: Cannot add invalid tag 37 in
Zotero.Item.addTagByID()

Initially, I thought this error occurs when I addTagByID with an
undefined tag id as an argument. I have now removed all calls to
addTagByID from zotfile and instead call addTag with the name of the
tag as a string argument. I mostly call addTag like this (att is an
attachment item):
att.addTag(this.prefs.getCharPref("tablet.tag"));

How can this go wrong? Any ideas?


Thanks!
Joscha

Dan Stillman

unread,
Jan 21, 2012, 4:00:42 AM1/21/12
to zoter...@googlegroups.com

It's not worth debugging unless they can reproduce it. If they manage
to, have them post a Debug ID for the operation that causes it to the
Zotero forums.

Joscha

unread,
Jan 21, 2012, 7:48:44 AM1/21/12
to zotero-dev
I will try to get the debug id and post here again...

Joscha

unread,
Jan 21, 2012, 3:00:42 PM1/21/12
to zotero-dev
Here is the debug ID (not from my account).
Thanks!

Joscha

The Debug ID is D1706542741.

"Just did it. Its always the same. I restarted FF, started pushing
and getting docs. On the third doc the push works, but then I cannot
get the doc back from dropbox."




On Jan 21, 4:00 am, Dan Stillman <dstill...@zotero.org> wrote:
Message has been deleted

Dan Stillman

unread,
Jan 22, 2012, 11:38:30 AM1/22/12
to zoter...@googlegroups.com
On 1/21/12 3:00 PM, Joscha wrote:
> Here is the debug ID (not from my account).
> Thanks!
>
> Joscha
>
> The Debug ID is D1706542741.
>
> "Just did it. Its always the same. I restarted FF, started pushing
> and getting docs. On the third doc the push works, but then I cannot
> get the doc back from dropbox."

This might be a bug in 2.1 that we've fixed in 3.0. If they can
reproduce it in 3.0, have them start a new thread in the forums with
Debug ID from that. 3.0 will be out soon if they don't want to run the
beta.

Joscha

unread,
Jan 23, 2012, 1:29:08 AM1/23/12
to zotero-dev
It's still happening in zotero 3.0. The Debug ID is D1056466452.
I am happy to refer the person to the zotero forum but I brought this
up here because the error is caused by a function in zotfile that
calls addTag and I want to fix that. I thought that I might be doing
something wrong but don't know what is going wrong when I call addTag
with a string as an argument.

Joscha

Dan Stillman

unread,
Jan 23, 2012, 1:10:40 PM1/23/12
to zoter...@googlegroups.com
There's probably a Zotero caching bug here that I need to fix, which is
why I suggested having the user post to the forums, but you might be
able to figure out what in your code is triggering it. It looks like a
tag is being created, added to an item, and then removed from the item
shortly after, which causes it to be purged from the database (during an
intervening auto-sync—you can trigger a purge manually with
Zotero.Tags.purge()). Then the tag is added to another item, but the tag
no longer exists. That's where a caching bug may be coming in, since it
should know that the tag doesn't exist, but you might want to look into
what's behind the rapid add/remove of the tag.
Reply all
Reply to author
Forward
0 new messages