Skip to content

Commit f86cd52

Browse files
committed
Merge pull request #122 from kufi/patch-2
Bugfix if own subtype of afe_single_upload
2 parents e6aefa0 + 594aedd commit f86cd52

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Form/EventListener/SingleUploadSubscriber.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function preSubmit(FormEvent $event)
4747
$post = $event->getData();
4848

4949
foreach ($form->all() as $child) {
50-
if ($child->getConfig()->getType()->getName() === 'afe_single_upload') {
50+
if ($this->isFieldSingleUpload($child->getConfig()->getType())) {
5151
$childPost = $post[$child->getName()];
5252
$options = $child->getConfig()->getOptions();
5353

@@ -140,4 +140,12 @@ public function postSubmit(FormEvent $event)
140140
}
141141
}
142142
}
143+
144+
private function isFieldSingleUpload(ResolvedFormTypeInterface $formTypeInterface = null)
145+
{
146+
if($formTypeInterface == null) return false;
147+
if($formTypeInterface->getName() == 'afe_single_upload') return true;
148+
149+
return $this->isFieldSingleUpload($formTypeInterface->getParent());
150+
}
143151
}

0 commit comments

Comments
 (0)