Bug 42020 - (Bug 39482 follow-up) Library info link shown in OPAC without OpacLibraryInfo and library URL
Summary: (Bug 39482 follow-up) Library info link shown in OPAC without OpacLibraryInfo...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Janusz Kaczmarek
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-07 14:05 UTC by Janusz Kaczmarek
Modified: 2026-03-08 02:18 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: Sponsored
Comma delimited list of Sponsors: Pontificia Università di San Tommaso d'Aquino (Angelicum), Pontificia Università di San Tommaso d'Aquino (Angelicum)
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the link to library information (the (i) icon) in the OPAC holdings table, before the current and home library name. The (i) icon now only appears if the OpacLibraryInfo HTML customization is defined. Before this, a link to library information was appearing even if OpacLibraryInfo was not defined. (If there is: - only a URL defined for the library, the current and home library is an active link to the website - an OpacLibraryInfo HTML customization AND a URL defined for the library, an (i) icon is shown and in the pop-up window there is the library information and a button with "Visit website".) (This is related to bug 39482 - Link to edit OpacLibraryInfo from library edit page broken, included in Koha 26.05.00 and 25.11.01.)
Version(s) released in:
Circulation function:


Attachments
Bug 42020: (Bug 39482 follow-up) Library info link shown in OPAC without OpacLibraryInfo and library URL (3.84 KB, patch)
2026-03-07 21:41 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 42020: (Bug 39482 follow-up) Library info link shown in OPAC without OpacLibraryInfo and library URL (3.89 KB, patch)
2026-03-08 01:51 UTC, David Nind
Details | Diff | Splinter Review
Bug 42020: (Bug 39482 follow-up) Library info link shown in OPAC without OpacLibraryInfo and library URL (3.96 KB, patch)
2026-03-08 02:18 UTC, David Nind
Details | Diff | Splinter Review
Bug 42020: (follow-up) Fix spelling for button - web site to website (1.45 KB, patch)
2026-03-08 02:18 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2026-03-07 14:05:52 UTC
Prior to Bug 39482 a link to library info modal (with (i) icon) was generated only if OpacLibraryInfo was defined. Now it is there even if there is no OpacLibraryInfo at all and no URL defined for the library. It is generated in any circumstances.

(BTW this makes the following snippet from opac-detail.tt dead:

[% ELSIF holding_library_url %]
    <a href="[% holding_library_url | url %]"> [% holding_library_name | html %] </a>
[% ELSE %]
    <span>[% holding_library_name | html %]</span>
[% END %]
)

This is because Koha::Library::opac_info returns a RS now, and not an object, as it was before. 

So a test on $item->holding_branch->opac_info( { lang => $lang } ) in opac-detail.pl returns always true.


To reproduce:
1) Have a standard ktd installation.
2) Make sure there is no OpacLibraryInfo defined in HTML customizations.
3) Make sure there is no URL for any library. 
4) In OPAC, perform any search. On a detail page you would see a link to an empty modal from the Current library items column.
Comment 1 Janusz Kaczmarek 2026-03-07 21:41:41 UTC Comment hidden (obsolete)
Comment 2 David Nind 2026-03-08 01:51:39 UTC Comment hidden (obsolete)
Comment 3 David Nind 2026-03-08 02:18:21 UTC
Created attachment 194938 [details] [review]
Bug 42020: (Bug 39482 follow-up) Library info link shown in OPAC without OpacLibraryInfo and library URL

Prior to Bug 39482 a link to library info modal (with (i) icon) was
generated only if OpacLibraryInfo was defined (cf. original Bug
29616). Now it is there even if there is no OpacLibraryInfo at all
and no URL defined for the library. It is generated in any
circumstances.

The test on $item->holding_branch->opac_info( { lang => $lang } ) in
opac-detail.pl now returns always true. This is because
Koha::Library::opac_info returns a RS now, and not an object, as it
was before (find_best_match --> search_for_display).

This patch restores the original behavior designed in Bug 29616.

Test plan:
1. Have a standard ktd installation.
2. Make sure there is no OpacLibraryInfo defined in HTML customizations.
3. Make sure there is no URL for any library.
4. In OPAC, perform any search. On a detail page you would see a link
   to an empty modal from the Current library items column.
5. Apply the patch ; restart_all.
6. Repeat p. 4. There should be no link generated now.
7. Extent the test to follow Bug 29616 logic:

A. One with both branches.branchurl and OpacLibraryInfo defined
B. One with branches.branchurl but no OpacLibraryInfo defined
C. One with OpacLibraryInfo defined but no branches.branchurl
D. One with neither branches.branchurl nor OpacLibraryInfo defined
(neither for a specific library, nor default one)

View the bibliographic detail page in the OPAC for title(s) which have
holdings from the libraries you configured above. In the holdings table,
check the behavior of the library name in the "Current library" or "Home
library" columns *

- Case A: The library name appears as a link with an "info" icon.
  Clicking it shows the library information in a modal window. In the
  modal footer, a "Visit web site" button should take you to the correct
  URL.
- Case B: The library name appears as a link without an icon. Clicking
  the link takes you to the correct URL.
- Case C: The library name appears as a link with an "info" icon.
  Clicking it shows the library information in a modal window. In the
  modal footer there is no "Visit web site" button.
- Case D: The library name is plain text.

* Display of "Current library" and/or "Home library" is controlled by
  the OpacLocationBranchToDisplay system preference.

Sponsored-by: Pontificia Università di San Tommaso d'Aquino (Angelicum)
Signed-off-by: David Nind <david@davidnind.com>
Sponsored-by: Pontificia Università di San Tommaso d'Aquino (Angelicum)
Comment 4 David Nind 2026-03-08 02:18:23 UTC
Created attachment 194939 [details] [review]
Bug 42020: (follow-up) Fix spelling for button - web site to website

Changes the spelling for the button in the pop-up window (when a
library URL is defined) - "Visit web site" to "Visit website".

The common spelling now is just website.

Signed-off-by: David Nind <david@davidnind.com>
Sponsored-by: Pontificia Università di San Tommaso d'Aquino (Angelicum)