Bugzilla – Attachment 112863 Details for
Bug 26896
SIP option holds_block_checkin does not actually block checkin of items on hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26896: Enable SIP option holds_block_checkin to actually block checkin of items with holds
Bug-26896-Enable-SIP-option-holdsblockcheckin-to-a.patch (text/plain), 3.89 KB, created by
David Nind
on 2020-11-02 19:23:50 UTC
(
hide
)
Description:
Bug 26896: Enable SIP option holds_block_checkin to actually block checkin of items with holds
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-11-02 19:23:50 UTC
Size:
3.89 KB
patch
obsolete
>From 43becc0b4cc7fbeabc4fa595957917f1733a9456 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 2 Nov 2020 09:50:42 -0500 >Subject: [PATCH] Bug 26896: Enable SIP option holds_block_checkin to actually > block checkin of items with holds > >It appears that at some point, the actual blocking of checkins on items >with holds got lost from the patch set. This slipped by because the sip >server still outputs everything correctly, but the unit tests don't >actually test to see if the checkout still exists afterward! > >Test plan: >1) Apply this patch >2) Prove t/db_dependent/SIP/Message.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/SIP/ILS/Transaction/Checkin.pm | 10 +++++++--- > t/db_dependent/SIP/Message.t | 5 ++++- > 2 files changed, 11 insertions(+), 4 deletions(-) > >diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm >index 6a38a958ac..274fda9325 100644 >--- a/C4/SIP/ILS/Transaction/Checkin.pm >+++ b/C4/SIP/ILS/Transaction/Checkin.pm >@@ -76,7 +76,9 @@ sub do_checkin { > } > > my ( $return, $messages, $issue, $borrower ); >+ > my $item = Koha::Items->find( { barcode => $barcode } ); >+ > my $human_required = 0; > if ( C4::Context->preference("CircConfirmItemParts") > && defined($item) >@@ -86,10 +88,12 @@ sub do_checkin { > $messages->{additional_materials} = 1; > } > >+ my $checkin_blocked_by_holds = $holds_block_checkin && $item->biblio->holds->count; >+ > $debug and warn "do_checkin() calling AddReturn($barcode, $branch)"; > ( $return, $messages, $issue, $borrower ) = > AddReturn( $barcode, $branch, undef, $return_date ) >- unless $human_required; >+ unless $human_required || $checkin_blocked_by_holds; > > if ( $checked_in_ok ) { > delete $messages->{ItemLocationUpdated}; >@@ -132,8 +136,8 @@ sub do_checkin { > $self->{item}->destination_loc($issue->item->homebranch); > $self->alert_type('04'); # send to other branch > } >- if ($messages->{ResFound}) { >- if ($holds_block_checkin) { >+ if ($messages->{ResFound} || $checkin_blocked_by_holds ) { >+ if ($checkin_blocked_by_holds) { > $self->alert_type('99'); > $return = 0; > } elsif ($branch eq $messages->{ResFound}->{branchcode}) { >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index 31baf30e3a..f3850f5b85 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -69,7 +69,7 @@ subtest 'Testing Patron Info Request V2' => sub { > subtest 'Checkin V2' => sub { > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >- plan tests => 33; >+ plan tests => 35; > $C4::SIP::Sip::protocol_version = 2; > test_checkin_v2(); > $schema->storage->txn_rollback; >@@ -657,6 +657,8 @@ sub test_checkin_v2 { > 'Issue record is gone now' ); > > # Test account option no_holds_check that prevents items on hold from being checked in via SIP >+ $issue = Koha::Checkout->new({ branchcode => $branchcode, borrowernumber => $patron1->{borrowernumber}, itemnumber => $item_object->itemnumber })->store; >+ is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item is checked out"); > Koha::Old::Checkouts->search({ issue_id => $issue->issue_id })->delete; > $server->{account}->{holds_block_checkin} = 1; > my $reserve_id = AddReserve({ >@@ -673,6 +675,7 @@ sub test_checkin_v2 { > is( substr($response,2,1), '0', 'OK flag is false when we check in an item on hold and we do not allow it' ); > is( substr($response,5,1), 'Y', 'Alert flag is set' ); > check_field( $respcode, $response, FID_SCREEN_MSG, 'Item is on hold, please return to circulation desk', 'Screen message is correct' ); >+ is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was not checked in"); > $hold->delete(); > $server->{account}->{holds_block_checkin} = 0; > >-- >2.11.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 26896
:
112843
|
112863
|
112897
|
112900