From b79970b2cf4581ec20782efc9265b1548705b8c0 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Mon, 23 May 2016 21:12:23 -0300 Subject: [PATCH] Bug 16572: Warnings on load_sql makes web installer fail Last patch on Bug 13669 redirects all strings to stderr, warning included. That makes web installer fail. To test: Current master (Bug 13669 pushed) 1) Try web installer, it fails 2) Apply this patch, try again, now succeeds* * Unless Mysql 5.7, that needs another bug. I'm not considering this a 'good' solution, just a quick fix. A better approach is welcomed, just obsolete this patch and upload a new one, I'll sign :) --- C4/Installer.pm | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index 1e6768e..cbb8597 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -427,22 +427,16 @@ sub load_sql { my $dbh = $self->{ dbh }; - my $dup_stderr; - do { - local *STDERR; - open STDERR, ">>", \$dup_stderr; - - eval { - DBIx::RunSQL->run_sql_file( - dbh => $dbh, - sql => $filename, - ); - }; + eval { + DBIx::RunSQL->run_sql_file( + dbh => $dbh, + sql => $filename, + ); }; # errors thrown while loading installer data should be logged - if( $dup_stderr ) { + if( $@ ) { warn "C4::Installer::load_sql returned the following errors while attempting to load $filename:\n"; - $error = $dup_stderr; + $error = $@; } -- 2.7.4