File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010use Doctrine \ORM \Events ;
1111use League \Flysystem \FilesystemException ;
1212use League \Flysystem \FilesystemOperator ;
13+ use League \Flysystem \UnableToDeleteFile ;
1314use League \Flysystem \Visibility ;
1415use RZ \Roadiz \Documents \Exceptions \DocumentWithoutFileException ;
1516use 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
You can’t perform that action at this time.
0 commit comments