View | Details | Raw Unified | Return to bug 33447
Collapse All | Expand All

(-)a/Koha/Biblio.pm (-5 / +11 lines)
Lines 35-40 use Koha::ArticleRequests; Link Here
35
use Koha::Biblio::Metadatas;
35
use Koha::Biblio::Metadatas;
36
use Koha::Biblio::ItemGroups;
36
use Koha::Biblio::ItemGroups;
37
use Koha::Biblioitems;
37
use Koha::Biblioitems;
38
use Koha::Cache::Memory::Lite;
38
use Koha::Checkouts;
39
use Koha::Checkouts;
39
use Koha::CirculationRules;
40
use Koha::CirculationRules;
40
use Koha::Item::Transfer::Limits;
41
use Koha::Item::Transfer::Limits;
Lines 267-277 sub pickup_locations { Link Here
267
268
268
    my $patron = $params->{patron};
269
    my $patron = $params->{patron};
269
270
271
    my $memory_cache = Koha::Cache::Memory::Lite->get_instance();
270
    my @pickup_locations;
272
    my @pickup_locations;
271
    foreach my $item_of_bib ( $self->items->as_list ) {
273
    foreach my $item ( $self->items->as_list ) {
272
        push @pickup_locations,
274
        my $cache_key = sprintf "Pickup_locations:%s:%s:%s:%s:%s",
273
          $item_of_bib->pickup_locations( { patron => $patron } )
275
           $item->itype,$item->homebranch,$item->holdingbranch,$item->ccode || "",$patron->branchcode||"" ;
274
          ->_resultset->get_column('branchcode')->all;
276
        my $item_pickup_locations = $memory_cache->get_from_cache( $cache_key );
277
        unless( $item_pickup_locations ){
278
          @{ $item_pickup_locations } = $item->pickup_locations( { patron => $patron } )->_resultset->get_column('branchcode')->all;
279
          $memory_cache->set_in_cache( $cache_key, $item_pickup_locations );
280
        }
281
        push @pickup_locations, @{ $item_pickup_locations }
275
    }
282
    }
276
283
277
    return Koha::Libraries->search(
284
    return Koha::Libraries->search(
278
- 

Return to bug 33447