Bug 38982

Summary: OpacLibraryInfo doesn't respect news expiration date
Product: Koha Reporter: David Roberts <david.roberts>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: chris.rowlands6, phil
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 38982: OpacLibraryInfo should respect news expiration date
Bug 38982: OpacLibraryInfo should respect news expiration date

Description David Roberts 2025-01-28 09:16:09 UTC
If you create an OpacLibraryInfo HTML customisation for a particular library and give it an expiration date in the past, it will continue to display in the OPAC. To reproduce:

1) Go to Tools > HTML customisations
2) Create a new entry, specify a library, and give it an expiration date of yesterday (or earlier)
3) Then go to the OPAC and look at the Libraries page (cgi-bin/koha/opac-library.pl?branchcode=XXXXX). The news item will still be visible. 
4) Also, if you do a catalogue search for an item in that library, look at the holdings in the search result, and in the Current and Home Library columns, an (I) information alert will show which when clicked will still show the expired news item. 

Once the expiry date has been reached, this news item should not display in the OPAC at all.
[+] Comment 1 Owen Leonard 2025-02-05 18:01:59 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2025-02-12 16:56:35 UTC
Created attachment 177948 [details] [review]
Bug 38982: OpacLibraryInfo should respect news expiration date

This patch updates the library detail view in the OPAC so that the
OpacLibraryInfo HTML customization respects the content block's
expiration date.

The patch also changes the "library_info" BLOCK to "library_details" to
avoid confusion.

To test, apply the patch and enable the OPACShowLibraries system
preference if necessary.

- Create an OpacLibraryInfo HTML customization if necessary:
  - In the staff client, go to Tools -> HTML customizations
  - Create a new entry in the display location "OpacLibraryInfo"
  - Create the entry with a publication date but no expiration date.

- In the OPAC, go to the "Libraries" page.
- View the details of a library you created OpacLibraryInfo for.
- Confirm that the content appears.
- Return to the staff interface and edit the entry, adding an expiration
  date in the past.
- In the OPAC, confirm that the content no longer appears.

Sponsored-by: Athens County Public Libraries
Comment 3 Phil Ringnalda 2025-03-15 19:48:07 UTC
That nicely fixes the Libraries link, but leaves the info popup from the library name in the holdings table (a lovely feature I didn't know existed) still showing.