From 239436af1b9e9e388d56a392de1b76ee47497684 Mon Sep 17 00:00:00 2001 From: Andreas Roussos Date: Mon, 9 Feb 2026 01:52:30 +0000 Subject: [PATCH] Bug 41795: Fix failing test in UNIMARC instances Previously, t/AuthoritiesMarc_MARC21.t would fail if you tried to run it from within a UNIMARC instance. This patch fixes that. Test plan: 1) Inside a UNIMARC instance, run the test and notice the subtest failure: $ prove -v t/AuthoritiesMarc_MARC21.t 2) Apply this patch. 3) Re-run the test and notice that it now completes without any failures. --- t/AuthoritiesMarc_MARC21.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/AuthoritiesMarc_MARC21.t b/t/AuthoritiesMarc_MARC21.t index 1babb42cd4..268a1a60d0 100755 --- a/t/AuthoritiesMarc_MARC21.t +++ b/t/AuthoritiesMarc_MARC21.t @@ -59,9 +59,17 @@ subtest "FindDuplicateAuthority tests" => sub { } ); + my $marcflavour = C4::Context->preference('marcflavour'); + my $field; + if ( $marcflavour eq 'MARC21' ) { + $field = '155'; # GENRE/FORM field in MARC21 + } elsif ( $marcflavour eq 'UNIMARC' ) { + $field = '280'; # GENRE/FORM field in UNIMARC + } + my $record = MARC::Record->new; $record->append_fields( - MARC::Field->new( '155', '', '', a => 'Potato' ), + MARC::Field->new( $field, '', '', a => 'Potato' ), ); t::lib::Mocks::mock_preference( 'SearchEngine', 'Zebra' ); -- 2.39.5