This patch removes the use of smartmatch operators in the search code.
Regards
To+
Edit: this revision uses 'grep' instead of Lists::MoreUtils::any
Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Tested search, no problems found.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
foreach my $field (@fields) {
my $data = $field->as_string( $subfield_letters, $facet->{sep} );
- unless ( $data ~~ @used_datas ) {
+ unless ( grep { /^$data$/ } @used_datas ) {
push @used_datas, $data;
$facets_counter->{ $facet->{idx} }->{$data}++;
}
use C4::Context;
my $searchengine = C4::Context->preference("SearchEngine");
-for ( $searchengine ) {
- when ( /^Solr$/ ) {
- warn "We use Solr";
- require 'opac/search.pl';
- exit;
- }
- when ( /^Zebra$/ ) {
+if ( $searchengine =~ /^Solr$/ ) {
+ warn "We use Solr";
+ require 'opac/search.pl';
+ exit;
+} elsif ( $searchengine =~ /^Zebra$/ ) {
- }
}
use C4::Output;
@sort_by = $cgi->param('sort_by');
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
foreach my $sort (@sort_by) {
- if ( $sort ~~ @allowed_sortby ) {
+ if ( grep { /^$sort$/ } @allowed_sortby ) {
$template->param($sort => 1);
}
}