Bug 3602: Fixes a log error for opac-search.pl if expanded_options is not defined.
authorGarry Collum <gcollum@gmail.com>
Sat, 12 Sep 2009 16:27:18 +0000 (12:27 -0400)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Sat, 19 Sep 2009 21:47:09 +0000 (23:47 +0200)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
opac/opac-search.pl

index 0cfb802..74f8fe5 100755 (executable)
@@ -218,10 +218,11 @@ if ( $template_type eq 'advsearch' ) {
                $template->param( expanded_options => C4::Context->preference("expandedSearchOption") );
        }
        # but let the user override it
-       if ( ($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 ) ) {
-       $template->param( expanded_options => $cgi->param('expanded_options'));
-       }
-
+       if (defined $cgi->param('expanded_options')) {
+           if ( ($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 ) ) {
+           $template->param( expanded_options => $cgi->param('expanded_options'));
+           }
+        }
     output_html_with_http_headers $cgi, $cookie, $template->output;
     exit;
 }