diff --git a/targets/eds/js/eds_results_article.js b/targets/eds/js/eds_results_article.js index ad78560..416b98a 100644 --- a/targets/eds/js/eds_results_article.js +++ b/targets/eds/js/eds_results_article.js @@ -41,7 +41,7 @@ Drupal.behaviors.roblib_search_eds_articles = { }) } if (typeof val.PLink !== 'undefined' && typeof val.PDF !== 'undefined' && val.PDF == 'pdflink'){ - items.push('
'); + items.push(''); } if (typeof val.PLink !== 'undefined' && typeof val.HTML !== 'undefined' && val.HTML == '1'){ items.push(''); diff --git a/targets/evergreen/js/evergreen_results.js b/targets/evergreen/js/evergreen_results.js index ccaa637..f83828a 100644 --- a/targets/evergreen/js/evergreen_results.js +++ b/targets/evergreen/js/evergreen_results.js @@ -7,9 +7,9 @@ Drupal.behaviors.roblib_search_evergreen = { try { numberOfDocs = data.numberOfRecords; } catch (err) { - // do nothing leave docLength at 0 + numberOfDocs = 0; } - if(numberOfDocs < 1){ + if(numberOfDocs === undefined || numberOfDocs < 1){ jQuery('#' + 'roblib-search-content-evergreen').empty().append('No Results'); jQuery('.pane-roblib-search-evergreen-roblib-search-evergreen-results').hide(); } else { diff --git a/targets/evergreen/roblib_search_evergreen.module b/targets/evergreen/roblib_search_evergreen.module index 8a90ae0..983b4f7 100644 --- a/targets/evergreen/roblib_search_evergreen.module +++ b/targets/evergreen/roblib_search_evergreen.module @@ -167,6 +167,7 @@ function roblib_search_evergreen_get_results($query) { $url = variable_get('roblib_search_evergreen_url', 'http://137.149.200.52'); $url_suffix = variable_get('roblib_search_evergreen_search_suffix', '/opac/extras/sru?version=1.1&operation=searchRetrieve&query='); $number_of_records = variable_get('roblib_search_evergreen_num_results', '5'); + $query = trim($query); $query = str_replace(' ', '%20AND%20',$query); //hack until the library decides if we want phrase or individual words $query .= '%20AND%20%22prince%20edward%20island%22'; $search_url = $url . $url_suffix . $query . '&maximumRecords=' . $number_of_records;