From 04e0bc2eb39138a48d1aec6fe27b93d270866612 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 29 Jan 2024 17:12:15 +0100 Subject: [PATCH] Bug 14670: Fix tests and import Sponsored-by: Orex Digital --- opac/opac-ISBDdetail.pl | 4 ++-- opac/opac-MARCdetail.pl | 4 ++-- opac/opac-detail.pl | 4 ++-- t/db_dependent/Record.t | 12 +++--------- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index f1e715d63db..6f1c0c2d33a 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -52,7 +52,7 @@ use C4::Biblio qw( GetMarcISSN TransformMarcToKoha ); -use C4::Record; +use C4::Record qw( marc2cites );; use C4::Reserves qw( IsAvailableForItemLevelRequest ); use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); use C4::Koha qw( @@ -229,6 +229,6 @@ if( C4::Context->preference('ArticleRequests') ) { } # Cites -$template->{VARS}->{'cites'} = marc2cites($record); +$template->param( cites => C4::Record::marc2cites($record) ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 9cf8821147c..87b340f8732 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -58,7 +58,7 @@ use C4::Biblio qw( GetMarcStructure TransformMarcToKoha ); -use C4::Record; +use C4::Record qw( marc2cites ); use C4::Reserves qw( IsAvailableForItemLevelRequest ); use C4::Members; use C4::Koha qw( GetNormalizedISBN ); @@ -381,6 +381,6 @@ $template->param( ); # Cites -$template->{VARS}->{'cites'} = marc2cites($record); +$template->param( cites => C4::Record::marc2cites($record) ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index cdeb4db9c1b..ae266a0c7f8 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -45,7 +45,7 @@ use C4::Biblio qw( GetMarcSubjects GetMarcUrls ); -use C4::Record; +use C4::Record qw( marc2cites ); use C4::Tags qw( get_tags ); use C4::XISBN qw( get_xisbns ); use C4::External::Amazon qw( get_amazon_tld ); @@ -1247,6 +1247,6 @@ if ( C4::Context->preference('OPACAuthorIdentifiers') ) { } # Cites -$template->{VARS}->{'cites'} = marc2cites($record); +$template->param( cites => C4::Record::marc2cites($record) ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/t/db_dependent/Record.t b/t/db_dependent/Record.t index 2688fd542a4..9c9b237c8e3 100755 --- a/t/db_dependent/Record.t +++ b/t/db_dependent/Record.t @@ -10,7 +10,7 @@ use C4::Context; use Koha::Database; BEGIN { - use_ok('C4::Record', qw( marc2marc marc2marcxml marcxml2marc marc2dcxml marc2modsxml marc2bibtex )); + use_ok('C4::Record', qw( marc2marc marc2marcxml marcxml2marc marc2dcxml marc2modsxml marc2bibtex marc2cites )); } my $schema = Koha::Database->new->schema; @@ -155,12 +155,6 @@ my @entity=C4::Record::_entity_encode("Björn"); is ($entity[0], "Björn", "Html umlauts"); - - -$marc->field('260')->add_subfields(a => 'Hogwarts'); +$marc->field('260')->add_subfields( a => 'Hogwarts' ); my $cites = marc2cites($marc); -is ($cites->{'Chicago'}, 'Rowling J.K, . 2011. Harry potter. Hogwarts: Reprints.', 'testing marc2cites'); - - - - +is( $cites->{'Chicago'}, 'Rowling J.K, . 2011. Harry potter. Hogwarts: Reprints.', 'testing marc2cites' ); -- 2.34.1