Bug 38982 - OpacLibraryInfo doesn't respect news expiration date
Summary: OpacLibraryInfo doesn't respect news expiration date
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-28 09:16 UTC by David Roberts
Modified: 2025-02-12 16:56 UTC (History)
1 user (show)

See Also:
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 (4.81 KB, patch)
2025-02-05 18:01 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38982: OpacLibraryInfo should respect news expiration date (5.11 KB, patch)
2025-02-12 16:56 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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