Bugzilla – Attachment 148584 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.64 KB, created by
Fridolin Somers
on 2023-03-23 07:10:22 UTC
(
hide
)
Description:
Bug 33297: (follow-up) DBRev check wrong preference exists
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2023-03-23 07:10:22 UTC
Size:
2.64 KB
patch
obsolete
>From 955d3b52c00d309172cb70d876b8e0a78eda04a3 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 >--- > .../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 1f94fcc98b..3df7ec1478 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.39.0
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