[Koha-patches] [PATCH] Bug 3602: Fixes a log error for opac-search.pl if expanded_options is not defined.

Garry Collum gcollum at gmail.com
Sat Sep 12 18:27:18 CEST 2009


---
 opac/opac-search.pl |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/opac/opac-search.pl b/opac/opac-search.pl
index 176b7ad..9261b55 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;
 }
-- 
1.5.6.5




More information about the Koha-patches mailing list