From ed1a0f0029c0bb804d1fa39a96b6fcb5d1a7d4b6 Mon Sep 17 00:00:00 2001
From: Fridolin Somers <fridolin.somers@biblibre.com>
Date: Wed, 11 May 2022 21:23:58 -1000
Subject: [PATCH] Bug 30740: Link to authorities 'used in' should not use equal

When showing an authority, there is a link to search biblio records it is used in.
Actually this link uses 'q=an=$auth_id', this is wrong for an URL, and other places use 'idx:value'.
It does not break search with Zebra nor Elasticsearch but it is better to use ':'

Test plan :
Check changed links return same results with and without patch

Signed-off-by: David Nind <david@davidnind.com>
---
 .../intranet-tmpl/prog/en/modules/authorities/authorities.tt    | 2 +-
 koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt   | 2 +-
 .../bootstrap/en/modules/opac-authoritiessearchresultlist.tt    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
index 2954c8d934..327607ca0d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
@@ -354,7 +354,7 @@
                     </div> <!-- /#toolbar -->
                     <div id="action">
                         [% IF count %]
-                                Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=[% authid | uri %]">[% count | html %] record(s)</a>
+                                Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an:[% authid | uri %]">[% count | html %] record(s)</a>
                         [% ELSE %]
                                 This authority is not used in any records.
                         [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt
index b753722ee3..5fbdf70b15 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt
@@ -62,7 +62,7 @@
 
 <div id="action">
     [% IF count %]
-        Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=[% authid | uri %]">[% count | html %] record(s)</a>
+        Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an:[% authid | uri %]">[% count | html %] record(s)</a>
     [% ELSE %]
         This authority is not used in any records.
     [% END %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt
index 9c0623c95f..27e000e504 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt
@@ -112,7 +112,7 @@
                                                 [% UNLESS ( resul.isEDITORS ) %]
                                                     <td>
                                                          [% IF resul.used > 0 %]
-                                                            <a href="/cgi-bin/koha/opac-search.pl?type=opac&amp;op=do_search&amp;q=an=[% resul.authid | uri %]">[% resul.used | html %] [% tn('record', 'records', resul.used ) | html %]</a>
+                                                            <a href="/cgi-bin/koha/opac-search.pl?type=opac&amp;op=do_search&amp;q=an:[% resul.authid | uri %]">[% resul.used | html %] [% tn('record', 'records', resul.used ) | html %]</a>
                                                         [% ELSE %]
                                                             0 records
                                                         [% END %]
-- 
2.30.2