Bugzilla – Attachment 39808 Details for
Bug 14320
Improve the speed of the checkouts table loading items with many holds and items using AllowRenewalIfOtherItemsAvailable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14320 - WIP
Bug-14320---WIP.patch (text/plain), 2.39 KB, created by
Kyle M Hall (khall)
on 2015-06-03 14:01:33 UTC
(
hide
)
Description:
Bug 14320 - WIP
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-06-03 14:01:33 UTC
Size:
2.39 KB
patch
obsolete
>From dabffa9bcb4fdb1534e4101ea112da352f857b32 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 3 Jun 2015 09:51:49 -0400 >Subject: [PATCH] Bug 14320 - WIP > >--- > C4/Circulation.pm | 30 +++++++++++++++++++++++------- > 1 files changed, 23 insertions(+), 7 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index f991680..3ba2793 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2700,18 +2700,34 @@ sub CanBookBeRenewed { > } > } > >+ # Avoid the overhead of GetMemberDetails, we don't need all that data >+ my @borrowers = $schema->resultset('Borrower')->search( >+ { -in => \@borrowernumbers }, >+ { >+ result_class => 'DBIx::Class::ResultClass::HashRefInflator', >+ } >+ ); >+ >+ # Avoid the overhead of GetMemberDetails, we don't need all that data >+ my @items = $schema->resultset('Item')->search( >+ { -in => \@itemnumbers }, >+ { >+ result_class => 'DBIx::Class::ResultClass::HashRefInflator', >+ } >+ ); >+ > # If the count of the union of the lists of reservable items for each borrower > # is equal or greater than the number of borrowers, we know that all reserves > # can be filled with available items. We can get the union of the sets simply > # by pushing all the elements onto an array and removing the duplicates. > my @reservable; >- foreach my $b (@borrowernumbers) { >- my ($borr) = C4::Members::GetMemberDetails($b); >- foreach my $i (@itemnumbers) { >- my $item = GetItem($i); >- if ( IsAvailableForItemLevelRequest( $item, $borr ) >- && CanItemBeReserved( $b, $i ) >- && !IsItemOnHoldAndFound($i) ) >+ foreach my $b (@borrowers) { >+ warn "B: $b"; >+ foreach my $i (@items) { >+ warn "I: $i"; >+ if ( IsAvailableForItemLevelRequest( $i, $b ) >+ && CanItemBeReserved( $b->{borrowernumber}, $i->{itemnumber} ) >+ && !IsItemOnHoldAndFound( $i->{itemnumber} ) ) > { > push( @reservable, $i ); > } >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14320
: 39808