(bug #3405) fix on loan list in search result
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Wed, 8 Jul 2009 11:46:48 +0000 (13:46 +0200)
committerGalen Charlton <galen.charlton@liblime.com>
Wed, 15 Jul 2009 03:24:25 +0000 (23:24 -0400)
The hash keys were made using a base and $item->{date_due}, but this key doesn't exists, so the possibility to have duplicate keys exists, and sometimes the others items were not shown. This patch fix this bug.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Search.pm

index 52bfc60..c43169f 100644 (file)
@@ -1376,7 +1376,7 @@ s/\[(.?.?.?.?)$tagsubf(.*?)]/$1$subfieldvalue$2\[$1$tagsubf$2]/g;
 # For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item
             if ( $item->{onloan} ) {
                 $onloan_count++;
-                               my $key = $prefix . $item->{due_date};
+                               my $key = $prefix . $item->{onloan} . $item->{barcode};
                                $onloan_items->{$key}->{due_date} = format_date($item->{onloan});
                                $onloan_items->{$key}->{count}++ if $item->{$hbranch};
                                $onloan_items->{$key}->{branchname} = $item->{branchname};