From ceb6d2f10020d606d00ac9d17ccb30a8828acb48 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Mon, 25 Jun 2018 15:21:45 +0000 Subject: [PATCH] Bug 15326: (follow-up) Don't make links to unpublished pages in opac Signed-off-by: Josef Moravec Signed-off-by: Michal Denar Signed-off-by: Michal Denar --- opac/opac-cmspages.pl | 2 +- opac/opac-main.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opac/opac-cmspages.pl b/opac/opac-cmspages.pl index 37d5e9f..1cc68d0 100755 --- a/opac/opac-cmspages.pl +++ b/opac/opac-cmspages.pl @@ -46,7 +46,7 @@ my ( $theme, $news_lang, $availablethemes ) = C4::Templates::themelanguage( # List all pages, if id is set generate parent page list and data. my ( $page_list, $parent_list, $page_data ) = Koha::CmsPages->list( $id ); -my $links = Koha::CmsPages->search( {}, { order_by => 'sortorder' } ); +my $links = Koha::CmsPages->search( { publish => 1 }, { order_by => 'sortorder' } ); my $cms_data = Koha::CmsPages->find( $id ); $template->param( links => $links, diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 20833f1..7b51da7 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -100,8 +100,8 @@ $template->param( my $id = scalar $input->param( 'id' ) // ''; my ( $page_list, $parent_list, $page_data ) = Koha::CmsPages->list( $id ); -my $links = Koha::CmsPages->search( {}, { order_by => 'parent' } ); -my $cms_data = Koha::CmsPages->page( $id ); +my $links = Koha::CmsPages->search( { publish => 1 }, { order_by => 'parent' } ); +my $cms_data = Koha::CmsPages->find( $id ); $template->param( links => $links, cms_page => $cms_data, -- 2.1.4