- Storage deletes were throwing fatals when they should throw warnings.

This commit is contained in:
JT Smith 2006-12-07 17:36:04 +00:00
parent fe302de9d0
commit 200b85f6ce
2 changed files with 10 additions and 6 deletions

View file

@ -3,6 +3,7 @@
when loading edit screens.
- Fixed a problem with the new autocommit code that caused reply posts not to
work in the collaboration system.
- Storage deletes were throwing fatals when they should throw warnings.
7.3.0

View file

@ -384,13 +384,16 @@ sub delete {
rmtree($path) if ($path);
foreach my $subDir ($self->{_part1}.'/'.$self->{_part2}, $self->{_part1}) {
my $uDir = $self->session->config->get('uploadsPath') . '/' . $subDir;
opendir my $DH, $uDir or
$self->session->errorHandler->fatal("Unable to open $uDir for directory reading");
my @dirs = grep { !/^\.+$/ } readdir($DH);
if (scalar @dirs == 0) {
rmtree($uDir);
opendir my $DH, $uDir;
if (defined $DH) {
my @dirs = grep { !/^\.+$/ } readdir($DH);
if (scalar @dirs == 0) {
rmtree($uDir);
}
close $DH;
} else {
$self->session->errorHandler->warn("Unable to open $uDir for directory reading");
}
close $DH;
}
}
return;