Bug 34062

Summary: Additional contents with library set do not appear in OPAC
Product: Koha Reporter: Hammat wele <hammat.wele>
Component: OPACAssignee: Hammat wele <hammat.wele>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, david, kelly, lucas, m.de.rooy, philippe.blouin
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 34062: Additional contents with library set do not appair in OPAC

Description Hammat wele 2023-06-20 00:34:56 UTC Comment hidden (obsolete)
Comment 1 Hammat wele 2023-06-20 00:41:19 UTC
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.»
Comment 2 Hammat wele 2023-06-20 00:44:49 UTC
Created attachment 152477 [details] [review]
Bug 34062: Additional contents with library set do not appair in OPAC

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
Comment 3 David Nind 2024-01-01 19:58:01 UTC
I had a go at testing (using KTD), but I couldn't replicate the issue.

When I refreshed the page, it displayed as expected - I didn't get the "This page does not exist". 

I was not logged in to the OPAC.

Before the test plan, I:
1. Edited the Apache configuration: sudo vi /etc/apache2/sites-available/kohadev.conf
2. In the virtual host section for the OPAC (<VirtualHost *:8080>) I added:
   SetEnv OPAC_BRANCH_DEFAULT "CPL"
3. Restarted everything (restart_all)
Comment 4 Lucas Gass (lukeg) 2024-01-02 15:31:06 UTC
This only deals with opac-page.pl ( custom page) but the test plan refers to additional contents. What about HTML customization and News? 

Also, I experience the same as David did: 

"I had a go at testing (using KTD), but I couldn't replicate the issue."
Comment 5 Lucas Gass (lukeg) 2024-01-03 16:15:40 UTC
FQA until we get some feedback.
Comment 6 Kelly McElligott 2024-02-12 20:28:30 UTC
We are testing this in 23.11.00 and this is also not working with library-specific messages within the HTML customizations, OPACResultSidebar. This does work with an 'all library' message.
Comment 7 Blou 2024-09-12 13:22:53 UTC
This is fixed in the master.  We can't reproduce it anymore, so I closed it on our end.  The patch still works on 24.05, but we don't see the value of putting time on it anymore.