diff --git a/src/js/modules/orcid/orcid_api.js b/src/js/modules/orcid/orcid_api.js index 6c69d430c..9d4c9be67 100644 --- a/src/js/modules/orcid/orcid_api.js +++ b/src/js/modules/orcid/orcid_api.js @@ -543,7 +543,11 @@ define([ var oldWork = cacheEntry.work; // check to see if the work is an error message, { error: {...} } - if (work.error) { + if (!work) { + + // something weird going on with work, just reject + promise.reject(); + } else if (work.error) { // check to see if it's just a conflict if (work.error['response-code'] === 409) { @@ -1007,7 +1011,7 @@ define([ Then we can add some metadata like whether it was an ADS sourced record or not */ - var updateRecord = function (k, v, out) { + var updateRecord = function (v, k, out) { // db is always 'identifier:xxx' var key = ('identifier:' + v).toLowerCase(); @@ -1034,7 +1038,7 @@ define([ if (_.isArray(value)) { _.each(value, updateRecord); } else { - updateRecord(key, value, out); + updateRecord(value, key, out); } }); diff --git a/src/js/modules/orcid/widget/widget.js b/src/js/modules/orcid/widget/widget.js index 9e9b655cd..b82e07076 100644 --- a/src/js/modules/orcid/widget/widget.js +++ b/src/js/modules/orcid/widget/widget.js @@ -207,6 +207,9 @@ define([ var start = 0; var docs = PaginationMixin.addPaginationToDocs(docs, start); _.each(docs, function (d,i) { + + // let each doc know if it's on the orcid widget page + d.isOrcidWidget = true; docs[i] = PapersUtilsMixin.prepareDocForViewing(d); }); return docs; diff --git a/src/js/widgets/list_of_things/templates/item-template.html b/src/js/widgets/list_of_things/templates/item-template.html index 9cc3b48ca..e616ab9e9 100644 --- a/src/js/widgets/list_of_things/templates/item-template.html +++ b/src/js/widgets/list_of_things/templates/item-template.html @@ -121,34 +121,37 @@

{{{title}}}

- {{#if authorFormatted}} - - - - {{else}} - no author information available - {{/if}} + {{/unless}} +