Fix arXiv ID not imported. Fix #2236. (#2238)

Mendeley online schema uses "arxiv", local DB uses "arxivId" hence it
was skipped. This commit adds mapping and a test.
This commit is contained in:
Tom Najdek 2021-11-04 20:32:35 +01:00 committed by GitHub
parent 882ecc205e
commit 7940915bb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -25,6 +25,7 @@ var mendeleyOnlineMappings = {
working_paper: 'WorkingPaper'
},
apiFieldToDBField: {
arxiv: 'arxivId',
accessed: 'dateAccessed',
authors: false, // all author types handled separately
citation_key: 'citationKey',

View file

@ -11,6 +11,12 @@
"profile_id": "8dbf0832-8723-4c48-b532-20c0b7f6e01a",
"read": false,
"source": "lorem ipsum",
"identifiers":
{
"doi": "10.1111",
"pmid": "11111111",
"arxiv": "1111.2222"
},
"starred": false,
"title": "Foo Bar",
"type": "journal",

View file

@ -102,6 +102,11 @@ describe('Zotero_Import_Mendeley', function () {
assert.equal(journal.itemTypeID, Zotero.ItemTypes.getID('journalArticle'));
assert.equal(report.getField('title'), 'Sample Report');
assert.equal(report.itemTypeID, Zotero.ItemTypes.getID('report'));
// test identifiers
assert.equal(journal.getField('DOI'), '10.1111');
assert.include(journal.getField('extra'), 'PMID: 11111111');
assert.include(journal.getField('extra'), 'arXiv: 1111.2222');
const parentCollection = await Zotero.Collections.getAsync(
journal.getCollections().pop()