From 448b9cd17eaf0efed8351dc8e2341af4deea15b6 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 --- 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 6bb19f4354..bddfa9639d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt @@ -103,7 +103,7 @@ -
+
diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/browse.js b/koha-tmpl/opac-tmpl/bootstrap/js/browse.js index b1ce79c4bf..cc37b89245 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/browse.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/browse.js @@ -68,7 +68,7 @@ $(document).ready(function () { card.find(".card-header") .attr("id", "heading" + index) .find("a") - .attr("data-target", "#collapse" + index) + .attr("data-bs-target", "#collapse" + index) .attr("aria-controls", "collapse" + index) .text(object.text); card.find(".collapse") @@ -96,7 +96,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");