Skip to content

Commit

Permalink
fixes vitiko#51
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Vanderstukken committed May 11, 2017
1 parent fd6fd16 commit 3440cdd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Form/Type/FileTypeBindSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ public function preSet(FormEvent $event)

$obj = $form->getParent()->getData();

if (!$obj) return;
if (!$obj) {
if ($data_class = $form->getParent()->getConfig()->getOption('data_class')) {
$obj = new $data_class();
}
else {
return;
}
}

$mapping = $this->mappingFactory->getMappingFromField($obj,
$this->dataStorage->getReflectionClass($obj),
Expand Down

0 comments on commit 3440cdd

Please sign in to comment.