From fe28b30f800273470ef734d88373b7f1b6073453 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 8 Apr 2019 12:14:13 +0100 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 Rebased-by: Martin Renvoize --- 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 37d5e9fccb..1cc68d0c4f 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 b3429a7ae8..c0c4c8c8b0 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -112,8 +112,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.20.1