Bugzilla – Attachment 107641 Details for
Bug 26108
Checkins should not require item to have been checked out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26108: Only call the plugin hook if a return took place
Bug-26108-Only-call-the-plugin-hook-if-a-return-to.patch (text/plain), 1.82 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-07-31 12:56:11 UTC
(
hide
)
Description:
Bug 26108: Only call the plugin hook if a return took place
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-07-31 12:56:11 UTC
Size:
1.82 KB
patch
obsolete
>From aeca1fddfd61896417b34b5c82c254d13855b619 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 31 Jul 2020 09:52:10 -0300 >Subject: [PATCH] Bug 26108: Only call the plugin hook if a return took place > >This patch makes the hooks be called only if the checkin is effective >(i.e. if it is not rejected for some reason. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t >=> FAIL: Tests fail >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Circulation.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 4b468f80f8..a9cf02ca3d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2124,7 +2124,7 @@ sub AddReturn { > my $lookahead= C4::Context->preference('ConfirmFutureHolds'); #number of days to look for future holds > ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->itemnumber, undef, $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 eq "Waiting" and $branch ne $resrec->{branchcode} ) { >+ if ( $resfound and $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) { > my $hold = C4::Reserves::RevertWaitingStatus( { itemnumber => $item->itemnumber } ); > $resfound = 'Reserved'; > $resrec = $hold->unblessed; >@@ -2206,7 +2206,7 @@ sub AddReturn { > } > } > >- if ( $issue ) { >+ if ( $doreturn and $issue ) { > my $checkin = Koha::Old::Checkouts->find($issue->id); > > Koha::Plugins->call('after_circ_action', { >-- >2.28.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 26108
:
107618
|
107640
| 107641