[Koha-patches] [PATCH] [followup](MT #2298) fix bad conditions
Nahuel ANGELINETTI
nahuel.angelinetti at biblibre.com
Thu Dec 3 13:46:54 CET 2009
This patch fix bad condition that hide in all cases records without items.
---
C4/Search.pm | 5 ++---
catalogue/search.pl | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/C4/Search.pm b/C4/Search.pm
index 313e9fd..5265172 100644
--- a/C4/Search.pm
+++ b/C4/Search.pm
@@ -1658,7 +1658,7 @@ sub searchResults {
? C4::Context->preference('maxItemsinSearchResults') - 1
: 1;
- if(! $limit_available){
+ if(not $limit_available){
for my $key ( sort keys %$onloan_items) {
(++$onloanitemscount > $maxitems) and last;
push @onloan_items_loop, $onloan_items->{$key};
@@ -1706,8 +1706,7 @@ sub searchResults {
$oldbiblio->{orderedcount} = $ordered_count;
$oldbiblio->{isbn} =~
s/-//g; # deleting - in isbn to enable amazon content
- push( @newresults, $oldbiblio ) if ((not $limit_available and ($items_count))
- or ($limit_available and $available_count));
+ push( @newresults, $oldbiblio ) if (not $limit_available or ($limit_available and $available_count));
#if((not $hidelostitems and not $limit_available )
#or ($items_count > $itemlost_count and $available_count ));
diff --git a/catalogue/search.pl b/catalogue/search.pl
index 6f4ec63..1f72467 100755
--- a/catalogue/search.pl
+++ b/catalogue/search.pl
@@ -378,7 +378,7 @@ if($params->{'multibranchlimit'}) {
push @limits, join(" or ", map { "branch: $_ "} @{GetBranchesInCategory($params->{'multibranchlimit'})}) ;
}
-my $available = $params->{'available'};
+my $available = $params->{'available'} || "0";
$template->param(available => $available);
--
1.6.3.3
More information about the Koha-patches
mailing list