diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 176b7ada5b..9261b5579e 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -219,10 +219,11 @@ if ( $template_type && $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; }