Don't allow trashing items in read-only or "no trash" libraries
This commit is contained in:
parent
e5a5a8d303
commit
6cef123662
|
@ -503,6 +503,15 @@ Zotero.Items = function() {
|
||||||
Zotero.Notifier.queue('delete', 'item', id);
|
Zotero.Notifier.queue('delete', 'item', id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!item.isEditable()) {
|
||||||
|
throw new Error(item._ObjectType + " (" + item.id + ") is not editable");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Zotero.Libraries.hasTrash(item.libraryID)) {
|
||||||
|
throw new Error(Zotero.Libraries.getName(item.libraryID) + " does not have Trash");
|
||||||
|
}
|
||||||
|
|
||||||
item.deleted = true;
|
item.deleted = true;
|
||||||
yield item.save({
|
yield item.save({
|
||||||
skipDateModifiedUpdate: true
|
skipDateModifiedUpdate: true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user