You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is only an issue since I've upgraded to symfony 3.2.
I have an ExamType form which has a collection of ExamVersionType forms. These latter contain 2 DatetimeType forms and 1 FileType form.
When adding a file, the ExamVersion (object) is being created, but the file itself is not stored. When I edit the Exam again and replace the file for the ExamVersion, then the file is stored.
I already debugged it quite a while and came to the conclusion that line 56 in Iphp\FileStoreBundle\Form\Type\FileTypeBindSubscriber.php $obj = $form->getParent()->getData();
is not returning anything. Therefore the file (and delete) field are not being added.
I noticed that when editing an existing ExamVersion, i.e. replacing the (unsaved) file, the object is an empty ExamVersion object. The mapping done on line 60 and following can properly complete and the file (& delete) field are being added to the form.
When I hardcoded set $obj = new ExamVersion() then everything seems to work fine.
I guess this is because it's being used inside a CollectionType. The form without data is being added in the Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener as a new form on line 122
if ($this->allowAdd) {
foreach ($data as $name => $value) {
if (!$form->has($name)) {
$form->add($name, $this->type, array_replace(array(
'property_path' => '['.$name.']',
), $this->options));
}
}
}
Now, why this form has no data, and how I can fix it... I still have no clue after debugging for over 2 days...
Can someone shed some light on this?
The text was updated successfully, but these errors were encountered:
sneakyvv
pushed a commit
to sneakyvv/IphpFileStoreBundle
that referenced
this issue
May 11, 2017
This is only an issue since I've upgraded to symfony 3.2.
I have an ExamType form which has a collection of ExamVersionType forms. These latter contain 2 DatetimeType forms and 1 FileType form.
When adding a file, the ExamVersion (object) is being created, but the file itself is not stored. When I edit the Exam again and replace the file for the ExamVersion, then the file is stored.
I already debugged it quite a while and came to the conclusion that line 56 in Iphp\FileStoreBundle\Form\Type\FileTypeBindSubscriber.php
$obj = $form->getParent()->getData();
is not returning anything. Therefore the file (and delete) field are not being added.
I noticed that when editing an existing ExamVersion, i.e. replacing the (unsaved) file, the object is an empty ExamVersion object. The mapping done on line 60 and following can properly complete and the file (& delete) field are being added to the form.
When I hardcoded set
$obj = new ExamVersion()
then everything seems to work fine.I guess this is because it's being used inside a CollectionType. The form without data is being added in the Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener as a new form on line 122
Now, why this form has no data, and how I can fix it... I still have no clue after debugging for over 2 days...
Can someone shed some light on this?
The text was updated successfully, but these errors were encountered: