Remove Item::copy()

Instead of creating a duplicate copy of the item with the same primary
data and saving that, it's safer just to use clone() (which doesn't
preserve ids) and apply changes to the main object.
This commit is contained in:
Dan Stillman 2016-03-11 03:33:25 -05:00
parent ae6d560a66
commit f310c39162

View file

@ -3721,17 +3721,6 @@ Zotero.Item.prototype.clone = function (libraryID, skipTags) {
}
/**
* @return {Promise<Zotero.Item>} - A copy of the item with primary data loaded
*/
Zotero.Item.prototype.copy = Zotero.Promise.coroutine(function* () {
var newItem = new Zotero.Item;
newItem.id = this.id;
yield newItem.loadPrimaryData();
return newItem;
});;
Zotero.Item.prototype._eraseData = Zotero.Promise.coroutine(function* (env) {
Zotero.DB.requireTransaction();