From 5956fab058127a5bcc70c2b6480db7e890bd49a9 Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Fri, 11 Aug 2023 11:31:24 +0000
Subject: [PATCH] Bug 29822: (QA follow-up) Use pipe for all field separators

- Tidy atomic update

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
---
 installer/data/mysql/atomicupdate/bug_29822.pl           | 6 ++++--
 .../intranet-tmpl/prog/en/includes/patronfields.inc      | 9 ++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/installer/data/mysql/atomicupdate/bug_29822.pl b/installer/data/mysql/atomicupdate/bug_29822.pl
index 73c0dfdfea..31e806a18b 100755
--- a/installer/data/mysql/atomicupdate/bug_29822.pl
+++ b/installer/data/mysql/atomicupdate/bug_29822.pl
@@ -8,13 +8,15 @@ return {
         my ( $dbh, $out ) = @$args{qw(dbh out)};
 
         # Do you stuffs here
-        $dbh->do(q{
+        $dbh->do(
+            q{
             UPDATE systempreferences
             SET
               value = REPLACE( value, ',', '|' )
             WHERE
               variable = 'DefaultPatronSearchFields'
-        });
+        }
+        );
         say $out "Updated system preference 'DefaultPatronSearchFields";
     },
 };
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc
index b4c5047863..03e6d49022 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc
@@ -87,12 +87,11 @@
         <select name="searchfieldstype" id="searchfieldstype_filter">
     [% END %]
         [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname|middle_name|surname|othernames|cardnumber|userid' %]
-        [% standard.replace('|', ',') %]
-        [% SET full_address = 'streetnumber,streettype,address,address2,city,state,zipcode,country' %]
-        [% SET all_emails = 'email,emailpro,B_email' %]
-        [% SET all_phones = 'phone,phonepro,B_phone,altcontactphone,mobile' %]
+        [% SET full_address = 'streetnumber|streettype|address|address2|city|state|zipcode|country' %]
+        [% SET all_emails = 'email|emailpro|B_email' %]
+        [% SET all_phones = 'phone|phonepro|B_phone|altcontactphone|mobile' %]
         [% default_fields = [ standard, 'surname', 'cardnumber', all_emails, 'borrowernumber', 'userid', all_phones, full_address, 'dateofbirth', 'sort1', 'sort2' ] %]
-        [% search_options = default_fields.merge(standard.split(',')).unique %]
+        [% search_options = default_fields.merge(standard.split('\|')).unique %]
         [% FOREACH s_o IN search_options %]
             [% display_name = PROCESS patron_fields name=s_o %]
             [% NEXT IF !display_name %]
-- 
2.30.2