@@ -, +, @@ --- Koha/Biblio.pm | 1 - opac/opac-request-article.pl | 21 +++++++++++++-------- t/db_dependent/Koha/Biblio/host_record.t | 1 - 3 files changed, 13 insertions(+), 10 deletions(-) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -910,7 +910,6 @@ sub host_record { my ($self, $params) = @_; my $no_items = $params->{no_items}; return if C4::Context->preference('marcflavour') eq 'UNIMARC'; # TODO - return if !C4::Context->preference('ArticleRequestsHostRedirection'); return if $params->{no_items} && $self->items->count > 0; my $record; --- a/opac/opac-request-article.pl +++ a/opac/opac-request-article.pl @@ -77,14 +77,19 @@ if ( $action eq 'create' ) { print $cgi->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests"); exit; -} elsif ( !$action ) { - # Should we redirect? - # Conditions: no items, host item entry (MARC21 773) - my ( $host, $pageinfo ) = $biblio->host_record({ no_items => 1 }); - if( $host ) { - $template->param( pageinfo => $pageinfo, title => $biblio->title, author => $biblio->author ); - $biblio = $host; - } +# Should we redirect? +} +elsif ( !$action && C4::Context->preference('ArticleRequestsHostRedirection') ) { + # Conditions: no items, host item entry (MARC21 773) + my ( $host, $pageinfo ) = $biblio->host_record( { no_items => 1 } ); + if ($host) { + $template->param( + pageinfo => $pageinfo, + title => $biblio->title, + author => $biblio->author + ); + $biblio = $host; + } } my $patron = Koha::Patrons->find($borrowernumber); --- a/t/db_dependent/Koha/Biblio/host_record.t +++ a/t/db_dependent/Koha/Biblio/host_record.t @@ -40,7 +40,6 @@ subtest 'host_record' => sub { t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); t::lib::Mocks::mock_preference( 'MARCOrgCode', 'xyz' ); - t::lib::Mocks::mock_preference( 'ArticleRequestsHostRedirection', 1 ); my $bib1 = $builder->build_object({ class => 'Koha::Biblios' }); my $bib2 = $builder->build_object({ class => 'Koha::Biblios' }); --