Bugzilla – Attachment 114697 Details for
Bug 26457
DB DeadLock when renewing checkout items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26457: Unit test
Bug-26457-Unit-test.patch (text/plain), 1.97 KB, created by
Nick Clemens (kidclamp)
on 2020-12-24 12:23:25 UTC
(
hide
)
Description:
Bug 26457: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-12-24 12:23:25 UTC
Size:
1.97 KB
patch
obsolete
>From 2fc6a6db1cde85792230da57128f475011eb0dab Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 24 Dec 2020 12:22:49 +0000 >Subject: [PATCH] Bug 26457: Unit test > >--- > C4/Circulation.pm | 4 +++- > t/db_dependent/Circulation.t | 7 ++++++- > 2 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 1221d8dedc..fc651d1f19 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3085,8 +3085,10 @@ sub AddRenewal { > AND itemnumber=?" > ); > >+ eval{ > $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $borrowernumber, $itemnumber ); >- if ( $sth->err ){ >+ }; >+ if( $sth->err ){ > Koha::Exceptions::Checkout::FailedRenewal->throw( > error => 'Update of issue# ' . $issue->issue_id . ' failed with error: ' . $sth->errstr > ); >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index f29c175aef..f1afd087e7 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -3694,7 +3694,7 @@ subtest 'AddReturn should clear items.onloan for unissued items' => sub { > > subtest 'AddRenewal and AddIssuingCharge tests' => sub { > >- plan tests => 12; >+ plan tests => 13; > > > t::lib::Mocks::mock_preference('item-level_itypes', 1); >@@ -3737,6 +3737,11 @@ subtest 'AddRenewal and AddIssuingCharge tests' => sub { > > # Check the item out > AddIssue( $patron->unblessed, $item->barcode ); >+ >+ throws_ok { >+ AddRenewal( $patron->borrowernumber, $item->itemnumber, $library->id, undef, {break=>"the_renewal"} ); >+ } 'Koha::Exceptions::Checkout::FailedRenewal', 'Exception is thrown when renewal update to issues fails'; >+ > t::lib::Mocks::mock_preference( 'RenewalLog', 0 ); > my $date = output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); > my %params_renewal = ( >-- >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 26457
:
114184
|
114185
|
114186
|
114187
|
114190
|
114669
|
114697
|
117227
|
117228
|
117371
|
117372
|
117373
|
117876
|
118647