From e249ea9b43883c34cbfea1b0a65645b0488b6d1f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 15 Jul 2025 11:56:36 +0200 Subject: [PATCH] Bug 40376: Remove warning from AuthorisedValues.t t/db_dependent/AuthorisedValues.t .. 1/17 DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'tagsubfield' on MarcSubfieldStructure - perhaps you forgot to set its 'is_auto_increment' attrib ute during add_columns()? Treating 'tagsubfield' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 174 It is a bit scary but it's only that we forgot to pass a value for tagsubfield (that is NOT NULL and part of the PK) Signed-off-by: David Nind --- t/db_dependent/AuthorisedValues.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t index cf07bfc0017..559cd2ec74a 100755 --- a/t/db_dependent/AuthorisedValues.t +++ b/t/db_dependent/AuthorisedValues.t @@ -194,8 +194,8 @@ subtest 'search_by_*_field + find_by_koha_field + get_description + authorised_v kohafield => 'items.restricted' } )->store; - Koha::MarcSubfieldStructure->new( { tagfield => '003', frameworkcode => '', authorised_value => 'CONTROL_TEST', } ) - ->store; + Koha::MarcSubfieldStructure->new( + { tagfield => '003', tagsubfield => '@', frameworkcode => '', authorised_value => 'CONTROL_TEST', } )->store; Koha::AuthorisedValue->new( { category => 'TEST', authorised_value => 'location_1', lib => 'location_1' } )->store; Koha::AuthorisedValue->new( { category => 'TEST', authorised_value => 'location_2', lib => 'location_2' } )->store; Koha::AuthorisedValue->new( { category => 'TEST', authorised_value => 'location_3', lib => 'location_3' } )->store; -- 2.39.5