Bugzilla – Attachment 89321 Details for
Bug 22841
Installer does not crash if a sql file is missing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22841: DO NOT PUSH - recreate the problem
Bug-22841-DO-NOT-PUSH---recreate-the-problem.patch (text/plain), 2.31 KB, created by
Jonathan Druart
on 2019-05-03 15:42:34 UTC
(
hide
)
Description:
Bug 22841: DO NOT PUSH - recreate the problem
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-05-03 15:42:34 UTC
Size:
2.31 KB
patch
obsolete
>From ee1fc385f6fc5ff090a0f6b08d7eb33e826306f0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 3 May 2019 11:42:16 -0400 >Subject: [PATCH] Bug 22841: DO NOT PUSH - recreate the problem > >--- > C4/Installer.pm | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index 4d577156ac..e8ed709478 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -321,7 +321,7 @@ sub load_sql_in_order { > my $av_cat = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/mandatory/auth_val_cat.sql"; > unshift(@fnames, $av_cat); > # Make sure the global sysprefs.sql file is loaded first >- my $globalsysprefs = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/sysprefs.sql"; >+ my $globalsysprefs = C4::Context->config('intranetdir') . "/installer/data/sysprefs.sql"; > unshift(@fnames, $globalsysprefs); > push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/userflags.sql"; > push @fnames, C4::Context->config('intranetdir') . "/installer/data/mysql/userpermissions.sql"; >@@ -331,6 +331,9 @@ sub load_sql_in_order { > # warn $file; > undef $/; > my $error = $self->load_sql($file); >+ warn "==="; >+ use Data::Printer colored => 1; warn p $error; >+ warn "==="; > my @file = split qr(\/|\\), $file; > $lang = $file[ scalar(@file) - 3 ] unless ($lang); > my $level = $file[ scalar(@file) - 2 ]; >@@ -447,12 +450,12 @@ sub load_sql { > > my $dbh = $self->{ dbh }; > >- my $dup_stderr; >+ my ( $dup_stderr, $nb_errors ); > do { > local *STDERR; > open STDERR, ">>", \$dup_stderr; > >- eval { >+ $nb_errors = eval { > DBIx::RunSQL->run_sql_file( > dbh => $dbh, > sql => $filename, >@@ -460,12 +463,13 @@ sub load_sql { > }; > }; > # errors thrown while loading installer data should be logged >- if( $dup_stderr ) { >+ warn "found $nb_errors errors"; >+ if( $nb_errors ) { > warn "C4::Installer::load_sql returned the following errors while attempting to load $filename:\n"; > $error = $dup_stderr; > } > >- return $error; >+ return $nb_errors ? $error : undef; > } > > =head2 get_file_path_from_name >-- >2.11.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 22841
: 89321