Bugzilla – Attachment 184371 Details for
Bug 40429
Koha/Patron/Modifications.t generates warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40429: Remove warnings from Koha/Patron/Modifications.t
Bug-40429-Remove-warnings-from-KohaPatronModificat.patch (text/plain), 4.70 KB, created by
Martin Renvoize (ashimema)
on 2025-07-18 12:19:50 UTC
(
hide
)
Description:
Bug 40429: Remove warnings from Koha/Patron/Modifications.t
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-07-18 12:19:50 UTC
Size:
4.70 KB
patch
obsolete
>From 8955dab38e6450590635e95e3efc87a884e1a4a3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 17 Jul 2025 09:51:02 +0200 >Subject: [PATCH] Bug 40429: Remove warnings from Koha/Patron/Modifications.t > >t/db_dependent/Koha/Patron/Modifications.t .. 1/7 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'borrowernumber' on BorrowerModification - perhaps you forgot to set its 'is_auto_increme >nt' attribute during add_columns()? Treating 'borrowernumber' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174 >t/db_dependent/Koha/Patron/Modifications.t .. 5/7 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'verification_token' on BorrowerModification - perhaps you forgot to set its 'is_auto_inc >rement' attribute during add_columns()? Treating 'verification_token' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174 > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > t/db_dependent/Koha/Patron/Modifications.t | 38 +++++++++++++--------- > 1 file changed, 23 insertions(+), 15 deletions(-) > >diff --git a/t/db_dependent/Koha/Patron/Modifications.t b/t/db_dependent/Koha/Patron/Modifications.t >index f430fa452da..147fc04dc84 100755 >--- a/t/db_dependent/Koha/Patron/Modifications.t >+++ b/t/db_dependent/Koha/Patron/Modifications.t >@@ -19,7 +19,8 @@ use Modern::Perl; > > use utf8; > >-use Test::More tests => 7; >+use Test::More tests => 8; >+use Test::NoWarnings; > use Test::Exception; > > use t::lib::TestBuilder; >@@ -49,9 +50,12 @@ subtest 'new() tests' => sub { > > Koha::Patron::Modifications->search->delete; > >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ > # Create new pending modification > Koha::Patron::Modification->new( > { >+ borrowernumber => $patron->borrowernumber, > verification_token => '1234567890', > changed_fields => 'surname,firstname', > surname => 'Hall', >@@ -443,9 +447,10 @@ subtest 'dateofbirth tests' => sub { > { class => 'Koha::Patrons', value => { dateofbirth => '1980-01-01', surname => 'a_surname' } } ); > my $patron_modification = Koha::Patron::Modification->new( > { >- changed_fields => 'borrowernumber,dateofbirth', >- borrowernumber => $patron->borrowernumber, >- dateofbirth => undef >+ verification_token => '1234567890', >+ changed_fields => 'borrowernumber,dateofbirth', >+ borrowernumber => $patron->borrowernumber, >+ dateofbirth => undef > } > )->store; > $patron_modification->approve; >@@ -459,9 +464,10 @@ subtest 'dateofbirth tests' => sub { > # Adding a dateofbirth > $patron_modification = Koha::Patron::Modification->new( > { >- changed_fields => 'borrowernumber,dateofbirth', >- borrowernumber => $patron->borrowernumber, >- dateofbirth => '1980-02-02' >+ verification_token => '1234567890', >+ changed_fields => 'borrowernumber,dateofbirth', >+ borrowernumber => $patron->borrowernumber, >+ dateofbirth => '1980-02-02' > } > )->store; > $patron_modification->approve; >@@ -476,10 +482,11 @@ subtest 'dateofbirth tests' => sub { > # Modifying a dateofbirth > $patron_modification = Koha::Patron::Modification->new( > { >- changed_fields => 'borrowernumber,dateofbirth', >- borrowernumber => $patron->borrowernumber, >- dateofbirth => '1980-03-03', >- surname => undef >+ verification_token => '1234567890', >+ changed_fields => 'borrowernumber,dateofbirth', >+ borrowernumber => $patron->borrowernumber, >+ dateofbirth => '1980-03-03', >+ surname => undef > } > )->store; > $patron_modification->approve; >@@ -494,10 +501,11 @@ subtest 'dateofbirth tests' => sub { > # Modifying something else > $patron_modification = Koha::Patron::Modification->new( > { >- changed_fields => 'borrowernumber,surname', >- borrowernumber => $patron->borrowernumber, >- surname => 'another_surname', >- dateofbirth => undef >+ verification_token => '1234567890', >+ changed_fields => 'borrowernumber,surname', >+ borrowernumber => $patron->borrowernumber, >+ surname => 'another_surname', >+ dateofbirth => undef > } > )->store; > $patron_modification->approve; >-- >2.50.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 40429
:
184184
|
184303
| 184371