From b746b1af4dafd4d46a35ded9b459d7320f0c1953 Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Mon, 17 Jul 2017 15:57:20 -0300 Subject: [PATCH] fixed error when results were missing pubYear --- targets/eds/js/eds_results.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/targets/eds/js/eds_results.js b/targets/eds/js/eds_results.js index 4787c9b..b290306 100644 --- a/targets/eds/js/eds_results.js +++ b/targets/eds/js/eds_results.js @@ -28,10 +28,9 @@ Drupal.behaviors.roblib_search_eds = { items.push(''+val2.Data+''); }) } - pubYear = val.RecordInfo.BibRelationships.IsPartOfRelationships["date"][0]["Y"]; - if(pubYear == 'undefined') { - pubYear = "Unknown"; - } + pubYear = val.RecordInfo.BibRelationships.IsPartOfRelationships["date"]; + !pubYear ? pubYear = " " : pubYear = pubYear[0]["Y"]; + if (typeof val.Items.TypPub !== 'undefined') { jQuery.each(val.Items.TypPub, function(key6, typpub){ strs = typpub.Data.split('; ');