From dedd91e602a5fbc3491da2208e0094c27a285048 Mon Sep 17 00:00:00 2001 From: Charles Farmer Date: Fri, 22 Jun 2018 16:28:33 -0400 Subject: [PATCH] Bug 14272: (follow-up) only display news available for a particular opac lang [alternative patch] --- opac/opac-main.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 9b620cf..bb75770 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -64,11 +64,15 @@ elsif (C4::Context->userenv and defined $input->param('branch') and length $inpu } my $news_id = $input->param('news_id'); -my (@all_koha_news, $koha_news_count); +my @all_koha_news; if (defined $news_id){ - @all_koha_news = Koha::News->search({ idnew => $news_id }); - $koha_news_count = 1; + @all_koha_news = Koha::News->search({ + idnew => $news_id, + lang => { + -in => [ $news_lang ], + } + }); if (scalar @all_koha_news > 0){ $template->param( news_item => @all_koha_news ); } else { -- 2.7.4