diff --git a/opac/opac-main.pl b/opac/opac-main.pl index b5a5b284e9..74755a05a5 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -64,8 +64,8 @@ my @all_koha_news; if (defined $news_id){ @all_koha_news = Koha::News->search({ idnew => $news_id, lang => { '!=', 'koha' } }); # get news that is not staff-only news - if (scalar @all_koha_news > 0){ - $template->param( news_item => @all_koha_news ); + if( @all_koha_news ) { # we only expect one btw + $template->param( news_item => $all_koha_news[0] ); } else { $template->param( single_news_error => 1 ); }