From 5850a591bd8c1137bc6bee2212bb781611f6daea Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 31 Jul 2026 15:29:25 +0000 Subject: [PATCH] Bug 31391: (QA follow-up) Fix Recall button visibility in holdings table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a problem with the template variables that made the recall button show in some places when UseRecalls was set to off. As the problem was in item-status.inc that is used in several pages, a small fix goes far here. Part 1: opac-detail.tt / opac-basket.tt (default config, useRecalls = 'off') 1) Confirm UseRecalls is at its default (off) 2) Check out item 39999000003154 to patron 'Henry Acevedo' 3) Log into the OPAC as a different patron (e.g. koha user) 4) As koha user, go to the biblio detail page for the record we just checked out: http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=76 5) Look at the item's status row: next to "Checked out", a "Recall" button is visible, even though UseRecalls is off. 6) Click it, lands on opac-recall.pl, shows a "Recalls have not been enabled. Please contact your library.", which confirms it's a dead-end button that never should have rendered. 7) Same thing reproduces in the basket: as koha user, add that biblio to your cart (Add to cart on the results/detail page), then click the cart icon on the top left. The same button erroneous will show. Part 2: opac-course-details.tt — staff-only mode still leaks the OPAC link 1) Continuing from the previous instructions: Set UseRecalls to "can be placed through the staff interface only". 2) Add the same checked-out item (39999000003154) to a course reserves list — http://localhost:8081/cgi-bin/koha/course_reserves/course-details.pl?course_id=1 3) Click "Add reserves" 4) As koha user on the OPAC, view that course's page: http://localhost:8080/cgi-bin/koha/opac-course-details.pl?course_id=1 5) The "Recall" button shows here too, even though UseRecalls=staff should mean OPAC patrons can't place recalls at all. Signed-off-by: Katrin Fischer Signed-off-by: Pedro Amorim --- koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index 2b7e5af6e0..41e0ba5774 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -63,7 +63,7 @@ Checked out [% END %] [% END %] - [% IF show_recall_link != "off" %] + [% IF Koha.Preference('UseRecalls').match('opac') %] [% IF logged_in_user.borrowernumber != issue.borrowernumber %] Recall [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt index e8f8165b9f..f975e7a782 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt @@ -109,7 +109,7 @@ [% cr.item.copynumber | html %] [% IF cr.item %] - [% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue show_recall_link=Koha.Preference('UseRecalls') %] + [% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %] [% END %] [% cr.issue.date_due | $KohaDates as_due_date => 1 %]