From 1d0f870a136d2f9f199ffa071fea01140db9919d Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 1 Jul 2024 12:28:56 +0000 Subject: [PATCH] Bug 24690: Make OPACPopupAuthorsSearch work with search terms containing parenthesis This patch updates the OPACPopupAuthorsSearch feature so that it wraps search terms with quotes. This is the behavior we have in place for author searches outside the context of OPACPopupAuthorisSearch, e.g. 'au:"Criterion Collection (Firm)"' To test, apply the patch and enable the OPACPopupAuthorsSearch system preference. - Search for a record in the OPAC which has author data containing parentheses (it should not be a field linked to an authority record). - View the detail page for that record. - Click on one of the problematic author links. - This should trigger a modal window with a list of authors and checkboxes for each. - With just the single checkbox checked, click "Search." - The search should return the correct results. - Test other author searches to confirm that they work too. Sponsored-by: Athens County Public Libraries Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer (cherry picked from commit d7ae20f0cb4bc0850896617aae59ec22fedcc71d) Signed-off-by: Lucas Gass (cherry picked from commit bf57e1432217427cfa05a3e808c27714480dd013) Signed-off-by: Fridolin Somers --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index c2daa1ee20..d76ec59154 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1951,7 +1951,7 @@ authid = $(this).data("authid"); search_string = "an:" + authid; } else { - search_string = terms[term]["keyword_search"] + encodeURIComponent( search_label ); + search_string = terms[term]["keyword_search"] + '"' + encodeURIComponent( search_label ) + '"'; } var termLink = $("
  • ") .append( $("", { type: "checkbox", class: "select_term", value: search_string, id: terms[term]["label"] + index } ).prop("checked", preselected ) )