Bug 3322: Fixes expandedSearchOption in opac. Makes "fewer options" possible.
authorGarry Collum <gcollum@gmail.com>
Wed, 15 Jul 2009 02:16:27 +0000 (22:16 -0400)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:19:21 +0000 (23:19 +0200)
Copies the logic of catalogue/search.pl to fix the expanded search option in opac. When expanded search is the default, it was impossible to go to the "fewer" options.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
opac/opac-search.pl

index 72fa0af..0c55cd3 100755 (executable)
@@ -231,11 +231,11 @@ if ( $template_type eq 'advsearch' ) {
                       search_boxes_loop => \@search_boxes_array);
 
 # use the global setting by default
-       if ( C4::Context->preference("expandedSearchOption") ) {
+       if ( C4::Context->preference("expandedSearchOption") == 1 ) {
                $template->param( expanded_options => C4::Context->preference("expandedSearchOption") );
        }
        # but let the user override it
-       if ( $cgi->param("expanded_options") && (($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 )) ) {
+       if ( ($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 ) ) {
        $template->param( expanded_options => $cgi->param('expanded_options'));
        }