Bugzilla – Attachment 114392 Details for
Bug 27196
Waiting title level hold checked in at wrong location via SIP leaves hold in a broken state and drops connection
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27196: Don't explode if item that is waiting if checked in by SIP
Bug-27196-Dont-explode-if-item-that-is-waiting-if-.patch (text/plain), 3.78 KB, created by
Nick Clemens (kidclamp)
on 2020-12-14 16:23:10 UTC
(
hide
)
Description:
Bug 27196: Don't explode if item that is waiting if checked in by SIP
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-12-14 16:23:10 UTC
Size:
3.78 KB
patch
obsolete
>From da645f1f9613639b4ffa5fe7d6b1016bdb1149cd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 14 Dec 2020 15:54:54 +0100 >Subject: [PATCH] Bug 27196: Don't explode if item that is waiting if checked > in by SIP > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/SIP/ILS/Transaction/Checkin.pm | 6 +++--- > t/db_dependent/SIP/Transaction.t | 40 ++++++++++++++++++++++++++++++++++++++- > 2 files changed, 42 insertions(+), 4 deletions(-) > >diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm >index 1b82a7138b..f674314e12 100644 >--- a/C4/SIP/ILS/Transaction/Checkin.pm >+++ b/C4/SIP/ILS/Transaction/Checkin.pm >@@ -1,4 +1,4 @@ >-# >+ > # An object to handle checkin status > # > >@@ -149,9 +149,9 @@ sub do_checkin { > } else { > $self->hold($messages->{ResFound}); > $self->alert_type('02'); >- ModReserveAffect( $messages->{ResFound}->{itemnumber}, >+ ModReserveAffect( $item->itemnumber, > $messages->{ResFound}->{borrowernumber}, 1, $messages->{ResFound}->{reserve_id}); >- ModItemTransfer( $messages->{ResFound}->{itemnumber}, >+ ModItemTransfer( $item->itemnumber, > $branch, > $messages->{ResFound}->{branchcode}, > $messages->{TransferTrigger}, >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index d9cbf35490..ee29265998 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -272,7 +272,7 @@ subtest do_hold => sub { > }; > > subtest do_checkin => sub { >- plan tests => 11; >+ plan tests => 12; > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $library2 = $builder->build_object( { class => 'Koha::Libraries' } ); >@@ -327,6 +327,44 @@ subtest do_checkin => sub { > is_deeply($result,{ messages => { 'NotIssued' => $item->barcode, 'WasTransfered' => 1 } },"Messages show not issued and transferred"); > is( $ci_transaction->item->destination_loc,$library->branchcode,"Item destination correctly set"); > >+ subtest 'Checkin an in transit item' => sub { >+ >+ plan tests => 5; >+ >+ my $library_1 = $builder->build_object({ class => 'Koha::Libraries' }); >+ my $library_2 = $builder->build_object({ class => 'Koha::Libraries' }); >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons', value => {branchcode => $library_1->branchcode, }}); >+ my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); >+ my $item = $builder->build_sample_item({ library => $library_1->branchcode }); >+ my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); >+ >+ t::lib::Mocks::mock_userenv( >+ { branchcode => $library_1->branchcode, flags => 1 } ); >+ >+ my $reserve = AddReserve( >+ { >+ branchcode => $library_1->branchcode, >+ borrowernumber => $patron->borrowernumber, >+ biblionumber => $item->biblionumber, >+ } >+ ); >+ >+ ModReserveAffect( $item->itemnumber, $patron->borrowernumber ); # Mark waiting >+ >+ my $ci_transaction = C4::SIP::ILS::Transaction::Checkin->new(); >+ is( $ci_transaction->patron($sip_patron), >+ $sip_patron, "Patron assigned to transaction" ); >+ is( $ci_transaction->item($sip_item), >+ $sip_item, "Item assigned to transaction" ); >+ >+ my $checkin = $ci_transaction->do_checkin($library_2->branchcode, C4::SIP::Sip::timestamp); >+ >+ my $hold = Koha::Holds->find($reserve); >+ is( $hold->found, 'T', ); >+ is( $hold->itemnumber, $item->itemnumber, ); >+ is( Koha::Checkouts->search({itemnumber => $item->itemnumber})->count, 0, ); >+ }; > }; > > subtest checkin_lost => sub { >-- >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 27196
:
114387
|
114392
|
114622
|
114693
|
115711
|
115757