diff --git a/src/Dravencms/AdminModule/Components/Gallery/GalleryGrid/GalleryGrid.php b/src/Dravencms/AdminModule/Components/Gallery/GalleryGrid/GalleryGrid.php index 73b9caa..39b813f 100644 --- a/src/Dravencms/AdminModule/Components/Gallery/GalleryGrid/GalleryGrid.php +++ b/src/Dravencms/AdminModule/Components/Gallery/GalleryGrid/GalleryGrid.php @@ -167,9 +167,13 @@ public function gridGroupActionDelete(array $ids) */ public function handleDelete($id) { - $locales = $this->galleryRepository->getById($id); - foreach ($locales AS $locale) + $galleries = $this->galleryRepository->getById($id); + foreach ($galleries AS $gallery) { + foreach($gallery->getPictures() AS $picture){ + $this->entityManager->remove($picture); + } + $this->entityManager->remove($locale); }