Bugzilla – Attachment 151282 Details for
Bug 33297
Typo system preference RetainPatronSearchTerms in DB revs 220600044.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33297: (follow-up) DBRev check wrong preference exists
Bug-33297-follow-up-DBRev-check-wrong-preference-e.patch (text/plain), 2.72 KB, created by
Jonathan Druart
on 2023-05-16 13:47:12 UTC
(
hide
)
Description:
Bug 33297: (follow-up) DBRev check wrong preference exists
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-05-16 13:47:12 UTC
Size:
2.72 KB
patch
obsolete
>From 7ef64d10af9ffa1ff24847bec10108cb88325cf0 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 22 Mar 2023 21:09:35 -1000 >Subject: [PATCH] Bug 33297: (follow-up) DBRev check wrong preference exists > >Better db upgrade messages > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../data/mysql/atomicupdate/bug_33297.pl | 29 ++++++++++++------- > 1 file changed, 18 insertions(+), 11 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_33297.pl b/installer/data/mysql/atomicupdate/bug_33297.pl >index 1f94fcc98bb..3df7ec1478f 100755 >--- a/installer/data/mysql/atomicupdate/bug_33297.pl >+++ b/installer/data/mysql/atomicupdate/bug_33297.pl >@@ -6,20 +6,27 @@ return { > up => sub { > my ($args) = @_; > my ($dbh, $out) = @$args{qw(dbh out)}; >- # Correct preference may have been generated via interface >- my ($correct_syspref_exists) = $dbh->selectrow_array(q{ >- SELECT COUNT(*) FROM systempreferences WHERE variable='RetainPatronsSearchTerms' >+ my ($wrong_syspref_exists) = $dbh->selectrow_array(q{ >+ SELECT COUNT(*) FROM systempreferences WHERE variable='RetainPatronSearchTerms' > }); >- if ($correct_syspref_exists) { >- $dbh->do(q{ >- DELETE FROM systempreferences WHERE variable='RetainPatronSearchTerms' >+ if ($wrong_syspref_exists) { >+ # Correct preference may have been generated via interface >+ my ($correct_syspref_exists) = $dbh->selectrow_array(q{ >+ SELECT COUNT(*) FROM systempreferences WHERE variable='RetainPatronsSearchTerms' > }); >- say $out "Wrong system preference 'RetainPatronSearchTerms' deleted"; >+ if ( $correct_syspref_exists ) { >+ $dbh->do(q{ >+ DELETE FROM systempreferences WHERE variable='RetainPatronSearchTerms' >+ }); >+ say $out "Wrong system preference 'RetainPatronSearchTerms' deleted"; >+ } else { >+ $dbh->do(q{ >+ UPDATE systempreferences SET variable='RetainPatronsSearchTerms' WHERE variable='RetainPatronSearchTerms' >+ }); >+ say $out "Wrong system preference 'RetainPatronSearchTerms' renamed 'RetainPatronsSearchTerms'"; >+ } > } else { >- $dbh->do(q{ >- UPDATE systempreferences SET variable='RetainPatronsSearchTerms' WHERE variable='RetainPatronSearchTerms' >- }); >- say $out "Wrong system preference 'RetainPatronSearchTerms' renamed 'RetainPatronsSearchTerms'"; >+ say $out "Wrong system preference 'RetainPatronSearchTerms' does not exist"; > } > }, > }; >-- >2.25.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 33297
:
148503
|
148504
|
148582
|
148583
|
148584
|
151280
|
151281
| 151282