Bugzilla – Attachment 167470 Details for
Bug 36453
BlockExpiredPatronOpacActions should allow multiple actions options
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36453: (QA follow-up) Modernise database update
Bug-36453-QA-follow-up-Modernise-database-update.patch (text/plain), 4.86 KB, created by
Martin Renvoize (ashimema)
on 2024-06-05 16:08:06 UTC
(
hide
)
Description:
Bug 36453: (QA follow-up) Modernise database update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-06-05 16:08:06 UTC
Size:
4.86 KB
patch
obsolete
>From 21f594698de64fb04ed949f24177be1520ba0cdd Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 5 Jun 2024 16:57:59 +0100 >Subject: [PATCH] Bug 36453: (QA follow-up) Modernise database update > >This patch adds the colored output expected for 24.11.x onward database >updates. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../data/mysql/atomicupdate/bug_36453.pl | 37 +++++++++++-------- > 1 file changed, 22 insertions(+), 15 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_36453.pl b/installer/data/mysql/atomicupdate/bug_36453.pl >index 08d6734d15d..ec3b81799dc 100755 >--- a/installer/data/mysql/atomicupdate/bug_36453.pl >+++ b/installer/data/mysql/atomicupdate/bug_36453.pl >@@ -1,4 +1,5 @@ > use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_failure say_success say_info); > > return { > bug_number => "36453", >@@ -7,6 +8,10 @@ return { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; > >+ # Update system preference setting to multiple instead of YesNo >+ $dbh->do("UPDATE systempreferences SET type='multiple' WHERE variable='BlockExpiredPatronOpacActions'"); >+ say_success( $out, "BlockExpiredPatronOpacActions system preference type updated to multiple." ); >+ > my ($BlockExpiredPatronOpacActions) = $dbh->selectrow_array( > q{ > SELECT value FROM systempreferences WHERE variable = 'BlockExpiredPatronOpacActions'; >@@ -19,41 +24,43 @@ return { > $dbh->do( > "UPDATE systempreferences SET value='hold,renew' WHERE variable='BlockExpiredPatronOpacActions' and value=1" > ); >- say $out "BlockExpiredPatronOpacActions system preference value updated to 'hold,renew'."; >+ say_info( $out, "BlockExpiredPatronOpacActions system preference value updated to 'hold,renew'." ); > } elsif ( $BlockExpiredPatronOpacActions eq 0 ) { > > # Update system preference settings if 0 > $dbh->do( > "UPDATE systempreferences SET value='' WHERE variable='BlockExpiredPatronOpacActions' and value=0"); >- say $out "BlockExpiredPatronOpacActions system preference value updated to empty string."; >+ say_info( $out, "BlockExpiredPatronOpacActions system preference value updated to an empty string." ); > } > >- # Update system preference setting to multiple instead of YesNo >- $dbh->do("UPDATE systempreferences SET type='multiple' WHERE variable='BlockExpiredPatronOpacActions'"); >- say $out "BlockExpiredPatronOpacActions system preference value updated to multiple."; >- > # Update categories database table BlockExpiredPatronOpacActions column settings > $dbh->do( > "ALTER TABLE categories MODIFY BlockExpiredPatronOpacActions mediumtext NOT NULL DEFAULT 'follow_syspref_BlockExpiredPatronOpacActions' COMMENT 'specific actions expired patrons of this category are blocked from performing or if the BlockExpiredPatronOpacActions system preference is to be followed'" > ); >- say $out "categories column BlockExpiredPatronOpacActions updated."; >+ say_success( $out, "Updated categories.BlockExpiredPatronOpacActions" ); > > # Update patron categories using -1 > $dbh->do( > "UPDATE categories SET BlockExpiredPatronOpacActions = 'follow_syspref_BlockExpiredPatronOpacActions' WHERE BlockExpiredPatronOpacActions = '-1'" >- ); >- say $out >- "Patron categories BlockExpiredPatronOpacActions = -1 have been updated to follow the syspref BlockExpiredPatronOpacActions."; >+ ) >= 1 >+ and say_info( >+ $out, >+ "Patron categories BlockExpiredPatronOpacActions = -1 have been updated to follow the syspref BlockExpiredPatronOpacActions." >+ ); > > # Update patron categories using 0 >- $dbh->do("UPDATE categories SET BlockExpiredPatronOpacActions = '' WHERE BlockExpiredPatronOpacActions = '0'"); >- say $out "Patron categories BlockExpiredPatronOpacActions = 0 have been updated to an empty string ('')."; >+ $dbh->do("UPDATE categories SET BlockExpiredPatronOpacActions = '' WHERE BlockExpiredPatronOpacActions = '0'") >+ >= 1 >+ and say_info( >+ $out, >+ "Patron categories BlockExpiredPatronOpacActions = 0 have been updated to an empty string ('')." >+ ); > > # Update patron categories using 1 > $dbh->do( > "UPDATE categories SET BlockExpiredPatronOpacActions = 'hold,renew' WHERE BlockExpiredPatronOpacActions = '1' " >- ); >- say $out "Patron categories BlockExpiredPatronOpacActions = 1 have been updated to hold,renew'."; >- >+ ) >= 1 >+ and >+ say_info( $out, "Patron categories BlockExpiredPatronOpacActions = 1 have been updated to hold,renew'." ); > }, > }; >-- >2.45.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 36453
:
164042
|
164043
|
164044
|
164045
|
164046
|
164047
|
164048
|
164762
|
164763
|
164764
|
164765
|
164766
|
164767
|
164768
|
165413
|
165414
|
165454
|
167461
|
167462
|
167463
|
167464
|
167465
|
167466
|
167467
|
167468
|
167469
|
167470
|
167471
|
167472
|
167473
|
167474
|
167475
|
167476
|
167477
|
167478
|
167479
|
167480
|
168435
|
168436