-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
I found that the bundle have problems when dealing with Doctrine\Common\Collections\Collection (ArrayCollection). On local test instance I have found that the problem is here:
Matthias\SymfonyConsoleForm\Bridge\Transformer\AbstractTransformer::defaultValueFrom
protected function defaultValueFrom(FormInterface $form)
{
$defaultValue = $form->getData();
if (is_array($defaultValue)) {
$defaultValue = implode(',', $defaultValue);
}
return $defaultValue;
}after changing it to:
protected function defaultValueFrom(FormInterface $form)
{
$defaultValue = $form->getData();
if (is_array($defaultValue)) {
$defaultValue = implode(',', $defaultValue);
} elseif ($defaultValue instanceof Collection) {
$defaultValue = implode(',', $defaultValue->toArray());
}
return $defaultValue;
}the Collection is handled properly and even form type Symfony\Bridge\Doctrine\Form\Type\EntityType is working very well.
Could you please look at this and apply the patch if the solution is valid?
Metadata
Metadata
Assignees
Labels
No labels