From 2ae12cf6c2567d7d0a0dfc74ea4cc653385728fd Mon Sep 17 00:00:00 2001 From: Alexander Blanchard Date: Tue, 10 Jun 2025 08:27:40 +0000 Subject: [PATCH] Bug 39223: Fix the OPAC browse search (opac-browse.pl) This fixes the OPAC browse search feature (OpacBrowseSearch system preference, Elasticsearch only). Expanding and collapsing the search results was not working. Test plan: 1. Start up KTD using Elasticsearch; ktd --es7 up 2. Enable the OpacBrowseSearch system preference. 3. In the OPAC, click 'Browse search' (one of the options under the search box). 4. Search for 'a', for the search type use Author, then click Search. 5. Click on one of the search results - note that it doesn't expand to show the titles for the author. 6. Apply the patch. 7. Refresh the page and repeat steps 3 to 5. Note that the author section now expands andd collapses when clicked, and that the titles for the author are now shown. Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Lucas Gass (cherry picked from commit 448b9cd17eaf0efed8351dc8e2341af4deea15b6) Signed-off-by: Paul Derscheid (cherry picked from commit f222847062946dc49a38893cd5411674a1d2e88b) Signed-off-by: Fridolin Somers --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/js/browse.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt index 92b05ac446..49d17245aa 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt @@ -104,7 +104,7 @@ -
+
diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/browse.js b/koha-tmpl/opac-tmpl/bootstrap/js/browse.js index 3a3bcc26a3..60f0e285ed 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/browse.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/browse.js @@ -60,7 +60,7 @@ $(document).ready(function(){ card .find(".card-header") .attr("id", "heading" + index) - .find("a").attr("data-target", "#collapse" + index) + .find("a").attr("data-bs-target", "#collapse" + index) .attr("aria-controls", "collapse" + index) .text(object.text); card @@ -89,7 +89,7 @@ $(document).ready(function(){ } var link = $(this); - var target = link.data("target"); + var target = link.data("bs-target"); var term = link.text(); var field = $('#browse-searchresults').data('field');