[Rt-commit] rt branch, 4.4/schema-missing-error, created. rt-4.4.2-133-g08d1312ea
? sunnavy
sunnavy at bestpractical.com
Fri Apr 13 11:54:54 EDT 2018
The branch, 4.4/schema-missing-error has been created
at 08d1312ea335b2c672a0cc1b97f57ab9b0701777 (commit)
- Log -----------------------------------------------------------------
commit 08d1312ea335b2c672a0cc1b97f57ab9b0701777
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Apr 13 23:35:19 2018 +0800
Fix the file name in the schema missing error message
Previously, there was "$file = $self->GetVersionFile( $dbh, $file )", so
$file could be undef if the version file couldn't be found. Sadly, we
used the same $file in the upcoming missing error message, so we got:
ERROR: Couldn't find schema file(s) '*'
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 2e77e493a..2b0e0c228 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -501,17 +501,17 @@ sub InsertSchema {
$file = $base_path;
}
- $file = $self->GetVersionFile( $dbh, $file );
- unless ( $file ) {
+ my $version_file = $self->GetVersionFile( $dbh, $file );
+ unless ( $version_file ) {
return (0, "Couldn't find schema file(s) '$file*'");
}
- unless ( -f $file && -r $file ) {
- return (0, "File '$file' doesn't exist or couldn't be read");
+ unless ( -f $version_file && -r $version_file ) {
+ return (0, "File '$version_file' doesn't exist or couldn't be read");
}
my (@schema);
- open( my $fh_schema, '<', $file ) or die $!;
+ open( my $fh_schema, '<', $version_file ) or die $!;
my $has_local = 0;
open( my $fh_schema_local, "<" . $self->GetVersionFile( $dbh, $RT::LocalEtcPath . "/schema." . $db_type ))
-----------------------------------------------------------------------
More information about the rt-commit
mailing list