Skip to content

Commit 34ebe4f

Browse files
committed
Update CollectionUploadSubscriber.php
revert
1 parent b313b37 commit 34ebe4f

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

Form/EventListener/CollectionUploadSubscriber.php

+2-14
Original file line numberDiff line numberDiff line change
@@ -217,21 +217,9 @@ public function postSubmit(FormEvent $event)
217217
{
218218
$form = $event->getForm();
219219
$data = $form->getParent()->getData();
220-
221-
$current = $form;
222-
$isAllValid = true;
223-
224-
// check recuresively this form and all it's parents
225-
do {
226-
if (!$current->isValid()) {
227-
$isAllValid = false;
228-
break;
229-
}
230-
$current = $current->getParent();
231-
} while (null !== $current);
232-
220+
233221
$getter = 'get'.ucfirst($this->propertyName);
234-
if (!$isAllValid && $data->$getter() instanceof ArrayCollection) {
222+
if (!$form->isValid() && $data->$getter() instanceof ArrayCollection) {
235223
// remove files absent in the original collection
236224
$data->$getter()->clear();
237225

0 commit comments

Comments
 (0)