Don't try to add child items to collections dragging cross-library
Previously, if you dragged a standalone attachment to a collection in another library where the item already existed as a child item, it would crash Zotero on a collection-item constraint.
This commit is contained in:
parent
0ab38f1d43
commit
395d596105
|
@ -1758,8 +1758,12 @@ Zotero.CollectionTreeView.prototype.drop = function(row, orient, dataTransfer)
|
||||||
|
|
||||||
// Add items to target collection
|
// Add items to target collection
|
||||||
if (targetCollectionID) {
|
if (targetCollectionID) {
|
||||||
var collection = Zotero.Collections.get(targetCollectionID);
|
let ids = newIDs.filter(function (itemID) {
|
||||||
collection.addItems(newIDs);
|
var item = Zotero.Items.get(itemID);
|
||||||
|
return !item.getSource();
|
||||||
|
});
|
||||||
|
let collection = Zotero.Collections.get(targetCollectionID);
|
||||||
|
collection.addItems(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If moving, remove items from source collection
|
// If moving, remove items from source collection
|
||||||
|
|
Loading…
Reference in New Issue
Block a user