@@ -, +, @@ --- C4/XSLT.pm | 4 ++-- Koha/Biblio.pm | 6 +++--- t/db_dependent/Koha/Biblio.t | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -278,12 +278,12 @@ sub XSLTParse4Display { my $biblio = Koha::Biblios->find( $biblionumber ); my $max_results = 300; - if ( $biblio->components($max_results) ) { + if ( $biblio->get_marc_components($max_results) ) { my $search_query = Koha::Util::Search::get_component_part_query($biblionumber); $variables->{ComponentPartQuery} = $search_query; my @componentPartRecordXML = (''); - for my $cb ( @{ $biblio->components($max_results) } ) { + for my $cb ( @{ $biblio->get_marc_components($max_results) } ) { if( ref $cb eq 'MARC::Record'){ $cb = $cb->as_xml_record(); } else { --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -500,16 +500,16 @@ sub suggestions { return Koha::Suggestions->_new_from_dbic( $suggestions_rs ); } -=head3 components +=head3 get_marc_components -my $components = $self->components(); + my $components = $self->get_marc_components(); Returns an array of MARCXML data, which are component parts of this object (MARC21 773$w points to this) =cut -sub components { +sub get_marc_components { my ($self, $max_results) = @_; return if (C4::Context->preference('marcflavour') ne 'MARC21'); --- a/t/db_dependent/Koha/Biblio.t +++ a/t/db_dependent/Koha/Biblio.t @@ -503,7 +503,7 @@ subtest 'suggestions() tests' => sub { $schema->storage->txn_rollback; }; -subtest 'components() tests' => sub { +subtest 'get_marc_components() tests' => sub { plan tests => 3; @@ -515,13 +515,13 @@ subtest 'components() tests' => sub { my $search_mod = Test::MockModule->new( 'Koha::SearchEngine::Zebra::Search' ); $search_mod->mock( 'simple_search_compat', \&search_component_record2 ); - my @components = $host_biblio->components; + my @components = $host_biblio->get_marc_components; is( ref(\@components), 'ARRAY', 'Return type is correct' ); is_deeply( [@components], [()], - '->components returns an empty ARRAY' + '->get_marc_components returns an empty ARRAY' ); $search_mod->unmock( 'simple_search_compat'); @@ -529,9 +529,9 @@ subtest 'components() tests' => sub { my $component_record = component_record1()->as_xml(); is_deeply( - $host_biblio->components, + $host_biblio->get_marc_components, [($component_record)], - '->components returns the related component part record' + '->get_marc_components returns the related component part record' ); $search_mod->unmock( 'simple_search_compat'); --