fixed typo to get all-formats suggestion working correctly
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 25 Jun 2006 16:07:53 +0000 (16:07 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 25 Jun 2006 16:07:53 +0000 (16:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4775 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/result_common.js

index 412b97e..07693db 100644 (file)
@@ -157,7 +157,7 @@ function resultLowHits() {
                areq.send();
        }
 
-       if( !(getForm() == null || getForm() == 'all' || getForm == "") ) {
+       if( !(getForm() == null || getForm() == 'all' || getForm() == "") ) {
                var a = {};
                a[PARAM_FORM] = "all";
                $('low_hits_remove_format_link').setAttribute('href',buildOPACLink(a));
@@ -266,7 +266,9 @@ function resultSuggestSpelling(r) {
 
        for( var w = 0; w < words.length; w++ ) {
                var word = words[w];
-               var blob = grep(res, function(i){return (i.word == word);})[0];
+               var blob = grep(res, function(i){return (i.word == word);});
+               if( blob ) blob = blob[0];
+               else continue;
                if( blob.word == word ) {
                        if( blob.suggestions && blob.suggestions[0] ) {
                                newterm += " " + blob.suggestions[0];