Skip to content

Commit 450ab76

Browse files
author
roadiz-ci
committed
Merge tag v2.6.16 into develop
1 parent 03e9069 commit 450ab76

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Events/DocumentLifeCycleSubscriber.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Doctrine\ORM\Events;
1111
use League\Flysystem\FilesystemException;
1212
use League\Flysystem\FilesystemOperator;
13+
use League\Flysystem\UnableToDeleteFile;
1314
use League\Flysystem\Visibility;
1415
use RZ\Roadiz\Documents\Exceptions\DocumentWithoutFileException;
1516
use RZ\Roadiz\Documents\Models\DocumentInterface;
@@ -132,8 +133,9 @@ public function postRemove(PostRemoveEventArgs $args): void
132133
$this->documentsStorage->delete($documentPath);
133134
}
134135
$this->cleanFileDirectory($this->getDocumentFolderPath($document));
135-
} catch (DocumentWithoutFileException) {
136-
// Do nothing when document does not have any file on system.
136+
} catch (UnableToDeleteFile|DocumentWithoutFileException) {
137+
// Do not prevent entity deletion when document does not have any file on system.
138+
// Do not prevent entity deletion when file cannot be deleted (permissions issue).
137139
}
138140
}
139141

0 commit comments

Comments
 (0)