Fix error in Mendeley import (regression from 8fc316f727)

"Zotero.Relations.getByPredicateAndObject(...).filter is not a function"
This commit is contained in:
Dan Stillman 2020-10-13 16:45:05 -04:00
parent bb8325ff9b
commit 6b626ba992

View file

@ -314,7 +314,7 @@ Zotero_Import_Mendeley.prototype._findExistingCollection = async function (libra
var predicate = 'mendeleyDB:remoteFolderUUID';
var uuid = collectionJSON.relations[predicate];
var collections = await Zotero.Relations.getByPredicateAndObject('collection', predicate, uuid)
var collections = (await Zotero.Relations.getByPredicateAndObject('collection', predicate, uuid))
.filter((c) => {
if (c.libraryID != libraryID) {
return false;
@ -963,7 +963,7 @@ Zotero_Import_Mendeley.prototype._findExistingItem = async function (libraryID,
Zotero_Import_Mendeley.prototype._getItemByRelation = async function (libraryID, predicate, object) {
var items = await Zotero.Relations.getByPredicateAndObject('item', predicate, object)
var items = (await Zotero.Relations.getByPredicateAndObject('item', predicate, object))
.filter(item => item.libraryID == libraryID && !item.deleted);
if (!items.length) {
return false;