From 7d87128026a63d4d0845aecee9cd833eff52d8fe Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 23 May 2022 15:21:40 +0100 Subject: [PATCH] Bug 7021: Catch new introductions of UpdateStats Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 2 +- Koha/Recalls.pm | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index b9272c91bd..3f322ab6c5 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2353,7 +2353,7 @@ sub AddReturn { location => $item->location, borrowernumber => $borrowernumber, ccode => $item->ccode, - categorycode => $patron->categorycode, + ( $patron_unblessed ? ( categorycode => $patron_unblessed->{categorycode} ) : () ), }); # Send a check-in slip. # NOTE: borrower may be undef. Do not try to send messages then. diff --git a/Koha/Recalls.pm b/Koha/Recalls.pm index ef73bf9917..b64d58332b 100644 --- a/Koha/Recalls.pm +++ b/Koha/Recalls.pm @@ -164,14 +164,17 @@ sub add_recall { $item = Koha::Items->find( $itemnumber ); # add to statistics table - C4::Stats::UpdateStats({ - branch => C4::Context->userenv->{'branch'}, - type => 'recall', - itemnumber => $itemnumber, - borrowernumber => $recall->patron_id, - itemtype => $item->effective_itemtype, - ccode => $item->ccode, - }); + C4::Stats::UpdateStats( + { + branch => C4::Context->userenv->{'branch'}, + type => 'recall', + itemnumber => $itemnumber, + borrowernumber => $recall->patron_id, + itemtype => $item->effective_itemtype, + ccode => $item->ccode, + categorycode => $checkout->patron->categorycode + } + ); # add action log C4::Log::logaction( 'RECALLS', 'CREATE', $recall->id, "Recall requested by borrower #" . $recall->patron_id, $interface ) if ( C4::Context->preference('RecallsLog') ); -- 2.39.5