Bugzilla – Attachment 174256 Details for
Bug 38299
Errors with updates caught in C4::Installer should be colored/highlighted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38299: Use say_failure when printing update errors to the console
Bug-38299-Use-sayfailure-when-printing-update-erro.patch (text/plain), 2.12 KB, created by
Emily Lamancusa (emlam)
on 2024-11-07 15:52:15 UTC
(
hide
)
Description:
Bug 38299: Use say_failure when printing update errors to the console
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2024-11-07 15:52:15 UTC
Size:
2.12 KB
patch
obsolete
>From b61e0700d6be3e5ccac7bf9cdf90d4552a7df85c Mon Sep 17 00:00:00 2001 >From: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Date: Thu, 7 Nov 2024 10:28:55 -0500 >Subject: [PATCH] Bug 38299: Use say_failure when printing update errors to the > console > >Bug 35681 added subroutines to print colored output from database >updates. Incorporate the subroutine say_failure into the error handling >in the upstream code, so that errors caught upstream can take advantage >of this new subroutine and display in red. > >To test: >1. Apply patch for test dbrev >2. From the kshell, run updatedatabase >--> The messages for success, info, warning, and failure that were > explicitly printed in the dbrev are colored, but the database error > is not colored. >3. Apply other patches >4. Run updatedatabase again >--> All messages including the database error are now colored >--- > installer/data/mysql/updatedatabase.pl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 3ce6a4ccca..a491bcf022 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -42,6 +42,7 @@ use Koha::Database; > use Koha; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Caches; >+use Koha::Installer::Output qw ( say_failure ); > > use MARC::Record; > use MARC::File::XML ( BinaryEncoding => 'utf8' ); >@@ -24301,7 +24302,7 @@ unless ( $ENV{HTTP_HOST} ) { # Is that correct? > } > for my $e ( @{ $report->{error} } ) { > say Encode::encode_utf8(join "\n", @{$e->{output}}); >- say Encode::encode_utf8("ERROR - " . $e->{error}); >+ say_failure( undef, Encode::encode_utf8("ERROR - " . $e->{error}) ); > $error_code = 1; > } > >@@ -24312,7 +24313,7 @@ unless ( $ENV{HTTP_HOST} ) { # Is that correct? > } > for my $e ( @{ $report->{error} } ) { > say Encode::encode_utf8(join "\n", @{$e->{output}}); >- say Encode::encode_utf8("ERROR - " . $e->{error}); >+ say_failure( undef, Encode::encode_utf8("ERROR - " . $e->{error}) ); > $error_code = 1; > } > exit $error_code; >-- >2.34.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 38299
:
174250
|
174251
|
174252
|
174254
|
174255
|
174256
|
174259
|
174290
|
174291
|
174292
|
174293
|
174421
|
174423
|
174424
|
174455
|
174673
|
174674
|
174675
|
174676
|
174677