[Koha-bugs] [Bug 6510] "Sort by" in intranet search alters search and number of hits

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 16 12:37:20 CEST 2011


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6510

--- Comment #1 from Magnus Enger <magnus at enger.priv.no> 2011-06-16 10:37:20 UTC ---
After some more digging, it looks like the problem stems from the regex on line
474 of catalogue/search.pl: 

472 for my $this_cgi ( split('&',$query_cgi) ) {
473     next unless $this_cgi;
474     $this_cgi =~ m/(.?)=(.*)/;
475     my $input_name = $1;
476     my $input_value = $2;
477     push @query_inputs, { input_name => $input_name, input_value =>
$input_value };
478         if ($input_name eq 'idx') {
479         $scan_index_to_use = $input_value; # unless $scan_index_to_use;
480         }
481 }
482 $template->param ( QUERY_INPUTS => \@query_inputs,
483                    scan_index_to_use => $scan_index_to_use );

.? is non-greedy and matches the minimum number of characters, which is the "x"
part of "idx", resulting in the behaviour described earlier. A patch proposing
to change that line to this: 

$this_cgi =~ m/(.*)=(.*)/;

is coming up...

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the Koha-bugs mailing list