Commit cd388888 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Suppression physique de l'ancien fichier lors du changement de logo d'une structure

parent 815ad284
Loading
Loading
Loading
Loading
+3 −1
Changes for module/Structure/src/Structure/Service/Structure/StructureService.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -850,6 +850,8 @@ class StructureService extends BaseService
     */
    public function deleteLogoStructure(StructureInterface $structure): bool
    {
        $cheminLogo = $structure->getCheminLogo();

        $structure->setCheminLogo(null);
        try {
            $this->entityManager->flush($structure);
@@ -860,7 +862,7 @@ class StructureService extends BaseService
            throw new RuntimeException("Erreur lors de l'enregistrement de la structure.", null, $e);
        }
        
        if ($hasLogo = ($structure->getCheminLogo() !== null)) {
        if ($hasLogo = ($cheminLogo !== null)) {
            try {
                $this->fichierStorageService->deleteFileForLogoStructure($structure);
            } catch (StorageAdapterException $e) {