Bugzilla – Attachment 136521 Details for
Bug 21978
Add middle name field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21978: (follow-up) Stop using C4 methods in atomicupdate
Bug-21978-follow-up-Stop-using-C4-methods-in-atomi.patch (text/plain), 2.14 KB, created by
Martin Renvoize (ashimema)
on 2022-06-24 15:19:01 UTC
(
hide
)
Description:
Bug 21978: (follow-up) Stop using C4 methods in atomicupdate
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-06-24 15:19:01 UTC
Size:
2.14 KB
patch
obsolete
>From a23abf02d291f99dc50f42772b74cc351023824a Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 18 May 2022 16:34:50 +0100 >Subject: [PATCH] Bug 21978: (follow-up) Stop using C4 methods in atomicupdate > >We should really only use C4::Context methods where absolutely >necessary.. in this case is was simple to replace the get_preference and >set_preference calls with SQL > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > installer/data/mysql/atomicupdate/bug_21978.pl | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_21978.pl b/installer/data/mysql/atomicupdate/bug_21978.pl >index 8abb859971..42d109ef8a 100755 >--- a/installer/data/mysql/atomicupdate/bug_21978.pl >+++ b/installer/data/mysql/atomicupdate/bug_21978.pl >@@ -33,11 +33,18 @@ return { > }); > say $out "Added middle name column to borrower_modifications table"; > } >- my @default_patron_search_fields = split(',',C4::Context->preference('DefaultPatronSearchFields')); >+ >+ my ($default_patron_search_fields) = $dbh->selectrow_array( q{ >+ SELECT value FROM systempreferences WHERE variable='DefaultPatronSearchFields'; >+ }); >+ my @default_patron_search_fields = split(',',$default_patron_search_fields); > unless( grep /middle_name/, @default_patron_search_fields ){ > if( grep /firstname/, @default_patron_search_fields ){ > push @default_patron_search_fields,'middle_name'; >- C4::Context->set_preference('DefaultPatronSearchFields', join(',',@default_patron_search_fields) ); >+ my $new_patron_search_fields = join(',',@default_patron_search_fields); >+ $dbh->do(q{ >+ UPDATE systempreferences SET value=? WHERE variable='DefaultPatronSearchFields' >+ }, undef, $new_patron_search_fields); > say $out "Added middle name to DefaultPatronSearchFields"; > } else { > say $out "Please add 'middlename' to DefaultPatronSearchFields if you want it searched by default"; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21978
:
133431
|
133432
|
133433
|
133434
|
133435
|
133436
|
133437
|
133438
|
133453
|
133454
|
133455
|
133456
|
133534
|
133535
|
133536
|
133537
|
133544
|
133545
|
133546
|
133547
|
133751
|
133752
|
133753
|
133754
|
133755
|
133756
|
133757
|
134254
|
134255
|
134256
|
134257
|
134258
|
134259
|
134495
|
134497
|
134498
|
134499
|
134500
|
134501
|
134502
|
134503
|
134745
|
134746
|
134747
|
134748
|
134749
|
134750
|
134751
|
135147
|
135148
|
135149
|
135150
|
135151
|
135152
|
135153
|
135154
|
135155
|
135180
|
135181
|
135182
|
135183
|
135184
|
135185
|
135186
|
135187
|
135188
|
135189
|
136513
|
136514
|
136515
|
136516
|
136517
|
136518
|
136519
|
136520
| 136521 |
136522
|
137612