Bug 7021: Catch new introductions of UpdateStats

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2022-05-23 15:21:40 +01:00 committed by Tomas Cohen Arazi
parent 980871b19f
commit 7d87128026
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 12 additions and 9 deletions

View File

@ -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.

View File

@ -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') );