Bugzilla – Attachment 129398 Details for
Bug 29869
Add Koha::Hold->fill
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29869: Remove C4::Reserves::ModReserveFill
Bug-29869-Remove-C4ReservesModReserveFill.patch (text/plain), 3.92 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-01-13 12:53:24 UTC
(
hide
)
Description:
Bug 29869: Remove C4::Reserves::ModReserveFill
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-01-13 12:53:24 UTC
Size:
3.92 KB
patch
obsolete
>From d57f86343dea5d1ead307087f5e2fb818987b4e5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 13 Jan 2022 09:45:12 -0300 >Subject: [PATCH] Bug 29869: Remove C4::Reserves::ModReserveFill > >--- > C4/Reserves.pm | 30 +++++------------------------- > C4/SIP/ILS/Item.pm | 8 ++++++-- > C4/SIP/ILS/Transaction/Checkout.pm | 1 - > 3 files changed, 11 insertions(+), 28 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 21a32bb404..c9a721033f 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -107,7 +107,6 @@ BEGIN { > ChargeReserveFee > GetReserveFee > >- ModReserveFill > ModReserveAffect > ModReserve > ModReserveStatus >@@ -1093,26 +1092,6 @@ sub ModReserve { > } > } > >-=head2 ModReserveFill >- >- &ModReserveFill($reserve); >- >-Fill a reserve. If I understand this correctly, this means that the >-reserved book has been found and given to the patron who reserved it. >- >-C<$reserve> specifies the reserve to fill. It is a reference-to-hash >-whose keys are fields from the reserves table in the Koha database. >- >-=cut >- >-sub ModReserveFill { >- my ($res) = @_; >- my $reserve_id = $res->{'reserve_id'}; >- >- my $hold = Koha::Holds->find($reserve_id); >- $hold->fill; >-} >- > =head2 ModReserveStatus > > &ModReserveStatus($itemnumber, $newstatus); >@@ -1795,7 +1774,7 @@ sub _Findgroupreserve { > _koha_notify_reserve( $hold->reserve_id ); > > Sends a notification to the patron that their hold has been filled (through >-ModReserveAffect, _not_ ModReserveFill) >+ModReserveAffect) > > The letter code for this notice may be found using the following query: > >@@ -1956,10 +1935,11 @@ sub MoveReserve { > my ( $restype, $res, undef ) = CheckReserves( $itemnumber, undef, $lookahead ); > return unless $res; > >- my $biblionumber = $res->{biblionumber}; >+ my $biblionumber = $res->{biblionumber}; > > if ($res->{borrowernumber} == $borrowernumber) { >- ModReserveFill($res); >+ my $hold = Koha::Holds->find( $res->{reserve_id} ); >+ $hold->fill; > } > else { > # warn "Reserved"; >@@ -1975,7 +1955,7 @@ sub MoveReserve { > > if ( $borr_res ) { > # The item is reserved by the current patron >- ModReserveFill($borr_res->unblessed); >+ $borr_res->fill; > } > > if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1 >diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm >index d57947a368..a85a557d00 100644 >--- a/C4/SIP/ILS/Item.pm >+++ b/C4/SIP/ILS/Item.pm >@@ -21,7 +21,6 @@ use C4::Circulation qw( barcodedecode ); > use C4::Context; > use C4::Items; > use C4::Members; >-use C4::Reserves qw( ModReserveFill ); > use Koha::Biblios; > use Koha::Checkouts::ReturnClaims; > use Koha::Checkouts; >@@ -404,13 +403,18 @@ sub barcode_is_borrowernumber { # because hold_queue only has borrowernumber. > return unless $converted; > return ($number == $converted); > } >+# FIXME: This methods is very likely not used. It's only reference in the codebase >+# is itself. I'm 'fixing' it so we can remove ModReserveFill. But filing a bug >+# for properly removing it. > sub fill_reserve { > my $self = shift; > my $hold = shift or return; > foreach (qw(biblionumber borrowernumber reservedate)) { > $hold->{$_} or return; > } >- return ModReserveFill($hold); >+ >+ my $hold_obj = Koha::Holds->find( $hold->id ); >+ return $hold_obj->fill; > } > > =head2 build_additional_item_fields_string >diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm >index f5c88766ca..b9fa51979e 100644 >--- a/C4/SIP/ILS/Transaction/Checkout.pm >+++ b/C4/SIP/ILS/Transaction/Checkout.pm >@@ -17,7 +17,6 @@ use C4::SIP::ILS::Transaction; > use C4::Context; > use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued ); > use C4::Members; >-use C4::Reserves qw(ModReserveFill); > use Koha::DateUtils; > > use parent qw(C4::SIP::ILS::Transaction); >-- >2.32.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 29869
:
129395
|
129396
|
129397
|
129398
|
129400
|
129405
|
129406
|
129407
|
129408
|
129409
|
129417
|
129418
|
129419
|
129420
|
129421
|
129502
|
129503
|
129504
|
129505
|
129506
|
129507