Error when adding a link or snapshot to the library (without a collection)

This commit is contained in:
Dan Stillman 2006-10-24 18:33:58 +00:00
parent 51664bc51a
commit 40edcdee91

View File

@ -270,10 +270,12 @@ Zotero.Attachments = new function(){
mimeType, charsetID, sourceItemID);
// Add to collections
var ids = Zotero.flattenArguments(parentCollectionIDs);
for each(var id in ids){
var col = Zotero.Collections.get(id);
col.addItem(itemID);
if (parentCollectionIDs){
var ids = Zotero.flattenArguments(parentCollectionIDs);
for each(var id in ids){
var col = Zotero.Collections.get(id);
col.addItem(itemID);
}
}
// Run the fulltext indexer asynchronously (actually, it hangs the UI
@ -339,10 +341,12 @@ Zotero.Attachments = new function(){
charsetID, sourceItemID, itemID);
// Add to collections
var ids = Zotero.flattenArguments(parentCollectionIDs);
for each(var id in ids){
var col = Zotero.Collections.get(id);
col.addItem(itemID);
if (parentCollectionIDs){
var ids = Zotero.flattenArguments(parentCollectionIDs);
for each(var id in ids){
var col = Zotero.Collections.get(id);
col.addItem(itemID);
}
}
Zotero.DB.commitTransaction();