From e31ca79722aaf9f1d1a499601f4e49c09a46fd6e Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Tue, 3 Apr 2012 15:41:01 -0400 Subject: [PATCH] Fix: recs without online_loc break results display Don't try to check a substring of rec.online_loc()[0] if there are no entries returned by rec.online_loc() to begin with. Manifests result_info_2 (with the prev/next links) not being visible on the bottom of the search results page when there are any bibs present in the results which have no online_loc() entries. Signed-off-by: Jeff Godin --- Open-ILS/web/opac/skin/tadlv2/js/rresult.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/web/opac/skin/tadlv2/js/rresult.js b/Open-ILS/web/opac/skin/tadlv2/js/rresult.js index c3471a36f2..ae86d8d1d3 100644 --- a/Open-ILS/web/opac/skin/tadlv2/js/rresult.js +++ b/Open-ILS/web/opac/skin/tadlv2/js/rresult.js @@ -309,7 +309,7 @@ function rresultHandleMods(r) { runEvt('result', 'recordReceived', rec, r.userdata, false); // Don't display copy counts if we're an online-only bib // FIXME: more robust logic, centralize and remove hardcoded string - if (rec.online_loc()[0].substring(0,20) != "http://via.tadl.org/") { + if (!rec.online_loc()[0] || rec.online_loc()[0].substring(0,20) != "http://via.tadl.org/") { resultCollectCopyCounts(rec, r.userdata, FETCH_R_COPY_COUNTS); } if(resultPageIsDone() && !recsReceivedCalled) { -- 2.11.0