- Storage deletes were throwing fatals when they should throw warnings.
This commit is contained in:
parent
fe302de9d0
commit
200b85f6ce
2 changed files with 10 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue