From: Martin Helmling martin.helmling@octosoft.eu Date: Fri, 10 Feb 2017 13:04:51 +0000 (+0100) Subject: Für t/file/filesystem.t Anpassungen im Debug und Fehlermeldung X-Git-Tag: release-3.5.4~1503 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6969d5c2475912e927c868e56b153ecacdfb817e;p=kivitendo-erp.git Für t/file/filesystem.t Anpassungen im Debug und Fehlermeldung Nun läuft der Test wieder --- diff --git a/SL/File.pm b/SL/File.pm index 31bebcfa4..3384f290d 100644 --- a/SL/File.pm +++ b/SL/File.pm @@ -126,7 +126,7 @@ sub delete { my $rc = SL::DB->client->with_transaction(\&_delete, $self, %params); if (!$rc) { my $err = SL::DB->client->error; - die (ref $err?$$err:$err); + die $err?(ref $err?$$err:$err):"unknown err"; } return $rc; } diff --git a/SL/File/Backend/Filesystem.pm b/SL/File/Backend/Filesystem.pm index a706c3820..19d81e334 100644 --- a/SL/File/Backend/Filesystem.pm +++ b/SL/File/Backend/Filesystem.pm @@ -54,8 +54,6 @@ sub rename { sub save { my ($self, %params) = @_; die 'dbfile not exists' unless $params{dbfile}; - $main::lxdebug->message(LXDebug->DEBUG2(), "in backend " . $self . " file " . $params{dbfile}); - $main::lxdebug->message(LXDebug->DEBUG2(), "file id=" . $params{dbfile}->id . " path=" . $params{file_path}); my $dbfile = $params{dbfile}; die 'no file contents' unless $params{file_path} || $params{file_contents}; $dbfile->backend_data(0) unless $dbfile->backend_data; @@ -63,7 +61,6 @@ sub save { $dbfile->save->load; my $tofile = $self->_filesystem_path($dbfile); - $main::lxdebug->message(LXDebug->DEBUG2(), "topath=" . $tofile . " from=" . $params{file_path}); if ($params{file_path} && -f $params{file_path}) { File::Copy::copy($params{file_path}, $tofile); } @@ -85,7 +82,7 @@ sub get_mtime { my ($self, %params) = @_; die "no dbfile" unless $params{dbfile}; $main::lxdebug->message(LXDebug->DEBUG2(), "version=" .$params{version}); - die "unknown version" if $params{version} && + die "unknown version" if $params{version} && ($params{version} < 0 || $params{version} > $params{dbfile}->backend_data) ; my $path = $self->_filesystem_path($params{dbfile},$params{version}); die "no file found in backend" if !-f $path; @@ -181,5 +178,3 @@ L Martin Helmling Emartin.helmling@opendynamic.deE =cut - -