Bug 29822: (QA follow-up) Use pipe for all field separators

- Tidy atomic update

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2023-08-11 11:31:24 +00:00 committed by Tomas Cohen Arazi
parent bfcdbeb9a8
commit cdedd6f2db
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 8 additions and 7 deletions

View file

@ -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";
},
};

View file

@ -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 %]