Bugzilla – Attachment 150963 Details for
Bug 33403
Letters.t: Foreign key exception if you do not have a numberpattern with id=1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33403: Fix Letters.t if number pattern with id=1 does not exist
Bug-33403-Fix-Letterst-if-number-pattern-with-id1-.patch (text/plain), 2.34 KB, created by
Jonathan Druart
on 2023-05-10 10:35:35 UTC
(
hide
)
Description:
Bug 33403: Fix Letters.t if number pattern with id=1 does not exist
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-05-10 10:35:35 UTC
Size:
2.34 KB
patch
obsolete
>From 1e588fc4f17e9eb554cfaf3252bb6df40b04d15c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 May 2023 12:34:08 +0200 >Subject: [PATCH] Bug 33403: Fix Letters.t if number pattern with id=1 does not > exist > >Bad assumption in DB, we should create the data we need > >Test plan: >> delete from subscription_numberpatterns; > >prove t/db_dependent/Letters.t >--- > t/db_dependent/Letters.t | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index 2f52882606d..3d1e34a6bbd 100755 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -549,12 +549,17 @@ use C4::Serials qw( NewSubscription GetSerials findSerialsByStatus ModSerialStat > > my $notes = 'notes'; > my $internalnotes = 'intnotes'; >-$dbh->do(q|UPDATE subscription_numberpatterns SET numberingmethod='No. {X}' WHERE id=1|); >+my $number_pattern = $builder->build_object( >+ { >+ class => 'Koha::Subscription::Numberpatterns', >+ value => { numberingmethod => 'No. {X}' } >+ } >+); > my $subscriptionid = NewSubscription( > undef, "", undef, undef, undef, $biblionumber, > '2013-01-01', 1, undef, undef, undef, > undef, undef, undef, undef, undef, undef, >- 1, $notes,undef, '2013-01-01', undef, 1, >+ 1, $notes,undef, '2013-01-01', undef, $number_pattern->id, > undef, undef, 0, $internalnotes, 0, > undef, undef, 0, undef, '2013-12-31', 0 > ); >@@ -643,12 +648,18 @@ subtest 'SendAlerts - claimissue' => sub { > } > my ($biblionumber) = AddBiblio($bib, ''); > >- $dbh->do(q|UPDATE subscription_numberpatterns SET numberingmethod='No. {X}' WHERE id=1|); >+ my $number_pattern = $builder->build_object( >+ { >+ class => 'Koha::Subscription::Numberpatterns', >+ value => { numberingmethod => 'No. {X}' } >+ } >+ ); >+ > my $subscriptionid = NewSubscription( > undef, "", $booksellerid, undef, undef, $biblionumber, > '2013-01-01', 1, undef, undef, undef, > undef, undef, undef, undef, undef, undef, >- 1, 'public',undef, '2013-01-01', undef, 1, >+ 1, 'public',undef, '2013-01-01', undef, $number_pattern->id, > undef, undef, 0, 'internal', 0, > undef, undef, 0, undef, '2013-12-31', 0 > ); >-- >2.25.1
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 33403
:
150963
|
150965