From 0d4cce4487d9bce07993c451330414885d6c736d Mon Sep 17 00:00:00 2001 From: muggystyle24 Date: Fri, 5 Apr 2024 14:55:11 +0800 Subject: [PATCH] bug:fix: ImageCollection images no longer array when delete image before last --- src/Controller/FormController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controller/FormController.php b/src/Controller/FormController.php index e9db1404..a546be4d 100644 --- a/src/Controller/FormController.php +++ b/src/Controller/FormController.php @@ -151,6 +151,9 @@ public function submitAction(Request $request, FileUploaderInterface $fileUpload // Convert uploaded files to string in form data if necessary, or retrieve current image path if edition $formData = $this->processFormData($form, $fileUploader, $data); + if (array_key_exists('images', $formData)) { + $formData['images'] = array_values($formData['images']); + } // Generate form render with error display if (!$form->isValid()) {