mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
fix: cloning projects failed with zotero- #253
This commit is contained in:
@@ -68,6 +68,7 @@ async function refreshLinkedFile(
|
||||
parentFolderId,
|
||||
userId
|
||||
) {
|
||||
linkedFileData = _normalizeLegacyData(linkedFileData)
|
||||
logger.debug(
|
||||
{ projectId, userId, linkedFileData },
|
||||
'refreshing Zotero linked file'
|
||||
@@ -108,7 +109,7 @@ async function _getBibtex(linkedFileData) {
|
||||
return await ZoteroApiClient.getLibraryBibtex(
|
||||
userId,
|
||||
linkedFileData.group_id, // == null for main library
|
||||
linkedFileData.format || 'bibtex'
|
||||
linkedFileData.format
|
||||
)
|
||||
} catch (err) {
|
||||
|
||||
@@ -129,6 +130,24 @@ async function _getBibtex(linkedFileData) {
|
||||
}
|
||||
}
|
||||
|
||||
// Files imported before "Zotero: fix for 6.3.0" use the old key names.
|
||||
function _normalizeLegacyData(data) {
|
||||
const {
|
||||
zoteroGroupId,
|
||||
importedByUserId,
|
||||
importedByName,
|
||||
bibFormat,
|
||||
...rest
|
||||
} = data
|
||||
return {
|
||||
...rest,
|
||||
group_id: rest.group_id ?? zoteroGroupId ?? null,
|
||||
importer_id: rest.importer_id ?? importedByUserId,
|
||||
importer_name: rest.importer_name ?? importedByName,
|
||||
format: rest.format ?? bibFormat,
|
||||
}
|
||||
}
|
||||
|
||||
function _sanitizeData(data) {
|
||||
return {
|
||||
provider: 'zotero',
|
||||
|
||||
Reference in New Issue
Block a user