Bugzilla – Attachment 150965 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.43 KB, created by
Marcel de Rooy
on 2023-05-10 11:06:50 UTC
(
hide
)
Description:
Bug 33403: Fix Letters.t if number pattern with id=1 does not exist
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-10 11:06:50 UTC
Size:
2.43 KB
patch
obsolete
>From 309442c1c3caa2a3fb260b6679ae0e25e3e9f664 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 >Content-Type: text/plain; charset=utf-8 > >Bad assumption in DB, we should create the data we need > >Test plan: >> delete from subscription_numberpatterns; > >prove t/db_dependent/Letters.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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 2f52882606..3d1e34a6bb 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.30.2
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