Bugzilla – Attachment 165542 Details for
Bug 36313
Check out/check in leads to error 500 in staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36313: Fix Undefined subroutine &C4::Circulation::CheckReserves error
Bug-36313-Fix-Undefined-subroutine-C4CirculationCh.patch (text/plain), 3.80 KB, created by
Martin Renvoize (ashimema)
on 2024-04-25 13:43:05 UTC
(
hide
)
Description:
Bug 36313: Fix Undefined subroutine &C4::Circulation::CheckReserves error
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-25 13:43:05 UTC
Size:
3.80 KB
patch
obsolete
>From 8a459cfce9653f76f8e03b8572e5b87c5f034a19 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Thu, 11 Apr 2024 13:12:58 +0300 >Subject: [PATCH] Bug 36313: Fix Undefined subroutine > &C4::Circulation::CheckReserves error > >On (at least) git installations of Koha checkouts and checkins fail on >error 500. Logs have following error: > >Undefined subroutine &C4::Circulation::CheckReserves called... > >Error happens also when one tries to open patrons checkouts from detail page. >Koha doesn't die but table just keeps loading. Solution is to add C4::Reserves >before CheckReserves when it's called from Circulation.pm. > >To test: >1. Apply this patch. >2. Try to check out and check in item. >=> Confirm both operations are succesfull. >3. Attempt to open patrons checkouts from patron detail and checkout page. >=> Table should load > >Also prove t/db_dependent/Circulation.t. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: BabaJaga <babajagawgoglach@gmail.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Circulation.pm | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 52f23309677..2d977e6b2ec 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -378,7 +378,7 @@ sub transferbook { > # find reserves..... > # That'll save a database query. > my ( $resfound, $resrec, undef ) = >- CheckReserves( $item ); >+ C4::Reserves::CheckReserves( $item ); > if ( $resfound ) { > $resrec->{'ResFound'} = $resfound; > $messages->{'ResFound'} = $resrec; >@@ -1177,7 +1177,7 @@ sub CanBookBeIssued { > > unless ( $ignore_reserves || $recall ) { > # See if the item is on reserve. >- my ( $restype, $res ) = CheckReserves( $item_object ); >+ my ( $restype, $res ) = C4::Reserves::CheckReserves( $item_object ); > if ($restype) { > my $resbor = $res->{'borrowernumber'}; > if ( $resbor ne $patron->borrowernumber ) { >@@ -1438,7 +1438,7 @@ sub checkHighHolds { > # Remove any items that are not holdable for this patron > # We need to ignore hold counts as the borrower's own hold that will be filled by the checkout > # could prevent them from placing further holds >- @items = grep { CanItemBeReserved( $patron, $_, undef, { ignore_hold_counts => 1 } )->{status} eq 'OK' } @items; >+ @items = grep { C4::Reserves::CanItemBeReserved( $patron, $_, undef, { ignore_hold_counts => 1 } )->{status} eq 'OK' } @items; > > my $items_count = scalar @items; > >@@ -2434,7 +2434,7 @@ sub AddReturn { > # launch the Checkreserves routine to find any holds > my ($resfound, $resrec); > my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds >- ($resfound, $resrec, undef) = CheckReserves( $item, $lookahead ) unless ( $item->withdrawn ); >+ ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item, $lookahead ) unless ( $item->withdrawn ); > # if a hold is found and is waiting at another branch, change the priority back to 1 and trigger the hold (this will trigger a transfer and update the hold status properly) > if ( $resfound and $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) { > my $hold = C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } ); >@@ -3056,7 +3056,7 @@ sub CanBookBeRenewed { > if ( $item->current_holds->search( { non_priority => 0 } )->count ); > > >- my ( $status, $matched_reserve, $possible_holds ) = CheckReserves($item); >+ my ( $status, $matched_reserve, $possible_holds ) = C4::Reserves::CheckReserves($item); > my @fillable_holds = (); > foreach my $possible_hold ( @{$possible_holds} ) { > push @fillable_holds, $possible_hold unless $possible_hold->{non_priority}; >-- >2.44.0
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 36313
:
164674
|
164859
| 165542