Bugzilla – Attachment 127613 Details for
Bug 29474
Automatic renewals cronjob is slow on systems with large numbers of reserves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29474: Check ItemsAnyAvailableAndNOtRestricted outside of loop
Bug-29474-Check-ItemsAnyAvailableAndNOtRestricted-.patch (text/plain), 2.07 KB, created by
Nick Clemens
on 2021-11-13 20:01:38 UTC
(
hide
)
Description:
Bug 29474: Check ItemsAnyAvailableAndNOtRestricted outside of loop
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2021-11-13 20:01:38 UTC
Size:
2.07 KB
patch
obsolete
>From 4f8ff82800429612d2263e346c6ac835a58abb6b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Sat, 13 Nov 2021 19:59:49 +0000 >Subject: [PATCH] Bug 29474: Check ItemsAnyAvailableAndNOtRestricted outside of > loop > >IsAvailableForItemLevelRequest takes $items_any_available to avoid >a double loop - this was done in request.pl, but it makes sense >to do the same here >--- > C4/Circulation.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 3e32a0f24b..f446d3ef3e 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -27,7 +27,7 @@ use Encode; > use Koha::DateUtils qw( dt_from_string output_pref ); > use C4::Context; > use C4::Stats qw( UpdateStats ); >-use C4::Reserves qw( CheckReserves CanItemBeReserved MoveReserve ModReserve ModReserveMinusPriority RevertWaitingStatus IsItemOnHoldAndFound IsAvailableForItemLevelRequest ); >+use C4::Reserves qw( CheckReserves CanItemBeReserved MoveReserve ModReserve ModReserveMinusPriority RevertWaitingStatus IsItemOnHoldAndFound IsAvailableForItemLevelRequest ItemsAnyAvailableAndNotRestricted ); > use C4::Biblio qw( UpdateTotalIssues ); > use C4::Items qw( ModItemTransfer ModDateLastSeen CartToShelf ); > use C4::Accounts; >@@ -2847,8 +2847,9 @@ sub CanBookBeRenewed { > my @reservable; > ITEM: while ( my $item = $items->next ) { > next if IsItemOnHoldAndFound( $item->itemnumber ); >+ my $items_any_available = ItemsAnyAvailableAndNotRestricted( { biblionumber => $item->biblionumber, patron => $patron }); > while ( my $patron = $patrons->next ) { >- next unless IsAvailableForItemLevelRequest($item, $patron); >+ next unless IsAvailableForItemLevelRequest($item, $patron, undef, $items_any_available); > next unless CanItemBeReserved($patron->borrowernumber,$item->itemnumber,undef,{ignore_hold_counts=>1})->{status} eq 'OK'; > push @reservable, $item->itemnumber; > if (@reservable >= @borrowernumbers) { >-- >2.20.1
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 29474
:
127610
|
127611
|
127612
|
127613
|
127614
|
127615
|
127616
|
127617
|
127632
|
127633
|
127634
|
127635
|
127658
|
127903
|
127904
|
127905
|
127906
|
127907
|
127949
|
127950
|
127951
|
127952
|
127953
|
128554
|
128555
|
128556