From 2d3ef7d5880af32858011346e014034af0eddba6 Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Tue, 20 Jun 2023 00:43:47 +0000 Subject: [PATCH] Bug 34062: Additional contents with library set do not appair in OPAC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we create an additional content and specify the library, we are not able to see the additional contents in the OPAC, the OPAC_BRANCH_DEFAULT is used only once, if we reload the page we can't see the additional contents anymore. To reproduce Add « SetENv OPAC_BRANCH_DEFAULT 'CPL' » in the koha-httpd.conf and restart or reload apache 1- Connect to the staff interface 2- Go to Tools->Pages 3- Click on New entry 4- Fill the following field Display location -> OPAC, library -> Centerville, Publication date -> today date, fill the title and the content 5- Save the form 6- get the created page id (select max(idnew) from additional_contents;) 7- Visit http://master/cgi-bin/koha/opac-page.pl?page_id=X (where X is the created page id) in a private tab --> the page is displayed well 8- refresh the page --> the page is no more displayed you get the message «This page does not exist.» 9- Apply the patch 10- Refresh the page --> the page is displayed --- opac/opac-page.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-page.pl b/opac/opac-page.pl index cba09dddfd..a4202dacc5 100755 --- a/opac/opac-page.pl +++ b/opac/opac-page.pl @@ -38,7 +38,7 @@ my $code = $query->param('code'); my $page; my $homebranch = $ENV{OPAC_BRANCH_DEFAULT}; -if (C4::Context->userenv) { +if (C4::Context->userenv && defined C4::Context->userenv->{'branch'}) { $homebranch = C4::Context->userenv->{'branch'}; } -- 2.34.1