Bugzilla – Attachment 71415 Details for
Bug 20144
Test suite is failing with new default SQL modes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20144: [sql_modes] Fix datatype for aqbasket.authorisedby
Bug-20144-sqlmodes-Fix-datatype-for-aqbasketauthor.patch (text/plain), 3.63 KB, created by
Julian Maurice
on 2018-02-12 09:43:58 UTC
(
hide
)
Description:
Bug 20144: [sql_modes] Fix datatype for aqbasket.authorisedby
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2018-02-12 09:43:58 UTC
Size:
3.63 KB
patch
obsolete
>From 28861ee9a05bbedcf66308fc7708080b741a8291 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 5 Feb 2018 15:32:28 -0300 >Subject: [PATCH] Bug 20144: [sql_modes] Fix datatype for aqbasket.authorisedby > >It's defined as a VARCHAR(10) in DB, but it is expecting a >borrowernumber instead > >Fix for >Data too long for column 'authorisedby' > >Must be a FK but first a borrowernumber >Need to update kohastructure for the comment? > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > t/db_dependent/Bookseller.t | 9 +++++---- > t/db_dependent/Koha/Acquisition/Booksellers.t | 5 +++-- > 2 files changed, 8 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Bookseller.t b/t/db_dependent/Bookseller.t >index 416974c1c2..c602ff4553 100644 >--- a/t/db_dependent/Bookseller.t >+++ b/t/db_dependent/Bookseller.t >@@ -46,6 +46,7 @@ $dbh->do(q|DELETE FROM aqbasket|); > $dbh->do(q|DELETE FROM aqbooksellers|); > $dbh->do(q|DELETE FROM subscription|); > >+my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > # Add currency > my $curcode = $builder->build({ source => 'Currency' })->{currencycode}; > >@@ -137,9 +138,9 @@ is_deeply( \@booksellers, \@tab, > my @bookseller1 = Koha::Acquisition::Booksellers->search({name => $sample_supplier1->{name} }); > is( $bookseller1[0]->baskets->count, 0, 'Supplier1 has 0 basket' ); > my $basketno1 = >- C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby1', 'basketname1' ); >+ C4::Acquisition::NewBasket( $id_supplier1, $patron->borrowernumber, 'basketname1' ); > my $basketno2 = >- C4::Acquisition::NewBasket( $id_supplier1, 'authorisedby2', 'basketname2' ); >+ C4::Acquisition::NewBasket( $id_supplier1, $patron->borrowernumber, 'basketname2' ); > @bookseller1 = Koha::Acquisition::Booksellers->search({ name => $sample_supplier1->{name} }); > is( $bookseller1[0]->baskets->count, 2, 'Supplier1 has 2 baskets' ); > >@@ -289,10 +290,10 @@ my $id_supplier4 = $supplier4->id; > > #Add 2 baskets > my $basketno3 = >- C4::Acquisition::NewBasket( $id_supplier3, 'authorisedby3', 'basketname3', >+ C4::Acquisition::NewBasket( $id_supplier3, $patron->borrowernumber, 'basketname3', > 'basketnote3' ); > my $basketno4 = >- C4::Acquisition::NewBasket( $id_supplier4, 'authorisedby4', 'basketname4', >+ C4::Acquisition::NewBasket( $id_supplier4, $patron->borrowernumber, 'basketname4', > 'basketnote4' ); > > #Modify the basket to add a close date >diff --git a/t/db_dependent/Koha/Acquisition/Booksellers.t b/t/db_dependent/Koha/Acquisition/Booksellers.t >index 42c29a61b7..31342e07af 100644 >--- a/t/db_dependent/Koha/Acquisition/Booksellers.t >+++ b/t/db_dependent/Koha/Acquisition/Booksellers.t >@@ -44,14 +44,15 @@ subtest '->baskets() tests' => sub { > $schema->resultset('Aqbasket')->delete(); > Koha::Acquisition::Booksellers->delete(); > $schema->resultset('Subscription')->delete(); >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > > my $vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); > > is( $vendor->baskets, 0, 'Vendor has no baskets' ); > > # Add two baskets >- my $basket_1_id = C4::Acquisition::NewBasket( $vendor->id, 'authorizedby1', 'basketname1' ); >- my $basket_2_id = C4::Acquisition::NewBasket( $vendor->id, 'authorizedby2', 'basketname2' ); >+ my $basket_1_id = C4::Acquisition::NewBasket( $vendor->id, $patron->borrowernumber, 'basketname1' ); >+ my $basket_2_id = C4::Acquisition::NewBasket( $vendor->id, $patron->borrowernumber, 'basketname2' ); > > # Re-fetch vendor > $vendor = Koha::Acquisition::Booksellers->find( $vendor->id ); >-- >2.14.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 20144
:
71410
|
71411
|
71412
|
71413
|
71414
| 71415 |
71416
|
71417
|
71418
|
71419
|
71420
|
71421
|
71422
|
71423
|
71424
|
71425
|
71427
|
71428
|
71429
|
71430
|
71431
|
71432
|
71434
|
71435
|
71436
|
71437
|
71438
|
71440
|
71441
|
71442
|
71443
|
71444
|
71445
|
71446
|
71447
|
71448
|
71449
|
71450
|
71451
|
71452
|
71453
|
71454
|
71455
|
71456
|
71457
|
71458
|
71459
|
71460
|
71461
|
71462
|
71463
|
71467
|
71564