From 6b0d3759ee9b090ed43521dc6a61604c4a012299 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 12 Nov 2024 15:23:30 +0000 Subject: [PATCH] Bug 38299: (discussion) Move failure into same level This patch adds the failures in at the same level as the rest of the revision output (i.e. indented under the specific database revision) and uses the standard failure coloring instead of the local update_error class. This is a proposal and may need more work to clarify and perhaps remove the duplicated/collected errors at the bottom of the update. Now that we hard stop if an update fails, I'm not sure collecting errors at the bottom makes as much sense as it once did? Signed-off-by: Jonathan Druart --- C4/Installer.pm | 2 ++ installer/data/mysql/updatedatabase.pl | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index 952b6290519..e70b0142a33 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -30,6 +30,7 @@ use C4::Context; use Koha::Schema; use Koha; use Koha::Installer; +use Koha::Installer::Output qw ( say_failure ); use vars qw(@ISA @EXPORT); BEGIN { @@ -742,6 +743,7 @@ sub run_db_rev { ); } catch { + say_failure( $outfh, "ERROR: " . $_ ); $error = $_; }; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a491bcf0220..f4f43a89c0d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -24302,7 +24302,7 @@ unless ( $ENV{HTTP_HOST} ) { # Is that correct? } for my $e ( @{ $report->{error} } ) { say Encode::encode_utf8(join "\n", @{$e->{output}}); - say_failure( undef, Encode::encode_utf8("ERROR - " . $e->{error}) ); + #say_failure( undef, Encode::encode_utf8("ERROR - " . $e->{error}) ); $error_code = 1; } @@ -24313,7 +24313,7 @@ unless ( $ENV{HTTP_HOST} ) { # Is that correct? } for my $e ( @{ $report->{error} } ) { say Encode::encode_utf8(join "\n", @{$e->{output}}); - say_failure( undef, Encode::encode_utf8("ERROR - " . $e->{error}) ); + #say_failure( undef, Encode::encode_utf8("ERROR - " . $e->{error}) ); $error_code = 1; } exit $error_code; -- 2.34.1