From 4de50f761ff9e149010a73d6dbfb1f1b46a2647d 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 Signed-off-by: alexandre --- 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 791ffa5448..d1a1b2b971 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 e44fab6418..def9933928 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 ); @@ -386,6 +386,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 cda32dbeed..8745cef582 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 ); @@ -1251,6 +1251,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 2688fd542a..9c9b237c8e 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