Mvolz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315105

Change subject: Fix typo that cause addItemType to fail
......................................................................

Fix typo that cause addItemType to fail

Bug: T98782
Change-Id: I6cf6aef8985e9ecc8aa0f38b605ee60a47df0a58
---
M lib/Scraper.js
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid 
refs/changes/05/315105/1

diff --git a/lib/Scraper.js b/lib/Scraper.js
index 6cc9efa..1e23d19 100644
--- a/lib/Scraper.js
+++ b/lib/Scraper.js
@@ -254,7 +254,10 @@
         if (cr.doi && (citation.itemType === 'journalArticle' || 
citation.itemType === 'conferencePaper')){
             citation.DOI = cr.doi;
         }
-
+        return cit;
+    // Rejection handle for addMetadata
+    }, function(){
+        logger.log('debug/scraper', "addMetadata failure");
         return cit;
     });
 
@@ -351,7 +354,6 @@
 function addItemType(metadata, citation){
     citation = citation || {};
     metadata = metadata || {};
-
     // Set citation type from metadata
     if (!citation.itemType){ // Don't overwrite itemtype
         if (metadata.bePress){
@@ -363,7 +365,7 @@
         else if (metadata.openGraph && metadata.openGraph['type'] && 
og.types[metadata.openGraph['type']]){ // if there is a type in the results and 
that type is defined   in openGraph.js
             citation.itemType = og.types[metadata.openGraph['type']];
         }
-        else if (metadata.dublinCore && metadata.openGraph['type'] && 
dc.types[metadata.dublinCore['type']]){ // if there is a type in the results 
and that type is defined in dublinCore.js
+        else if (metadata.dublinCore && metadata.dublinCore['type'] && 
dc.types[metadata.dublinCore['type']]){ // if there is a type in the results 
and that type is defined in dublinCore.js
             citation.itemType = dc.types[metadata.dublinCore['type']];
         }
         else {

-- 
To view, visit https://gerrit.wikimedia.org/r/315105
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6cf6aef8985e9ecc8aa0f38b605ee60a47df0a58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid
Gerrit-Branch: master
Gerrit-Owner: Mvolz <mv...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to