Merge remote-tracking branch 'origin/new/bug_6291'
[koha.git] / C4 / Installer.pm
index 80ef627..a7eb1f6 100644 (file)
@@ -354,6 +354,9 @@ sub load_sql_in_order {
     $request->execute;
     my ($systempreference) = $request->fetchrow;
     $systempreference = '' unless defined $systempreference; # avoid warning
+    # Make sure the global sysprefs.sql file is loaded first
+    my $globalsysprefs = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}/sysprefs.sql";
+    unshift(@fnames, $globalsysprefs);
     foreach my $file (@fnames) {
         #      warn $file;
         undef $/;
@@ -526,8 +529,10 @@ sub load_sql {
         # report the import a failure although it really succeded -fbcit
     }
 #   errors thrown while loading installer data should be logged
-    warn "C4::Installer::load_sql returned the following errors while attempting to load $filename:\n";
-    warn $error;
+    if($error) {
+      warn "C4::Installer::load_sql returned the following errors while attempting to load $filename:\n";
+      warn "$error";
+    }
     return $error;
 }