Closed denys281 closed 10 years ago
Please, look inside the generated form type file (in cache directory) and copy/paste the corresponding code.
Thank you,
I had the same issue. It works if the form is declared as a service and instead of the path you just name the service in the 'type' option.
I have the same issue.
In my programm I have an object Team with collection of Members. They includes in Team-generator.yml like this:
embed_types:
- "Member-generator.yml"
fields:
members:
label: label.members
dbType: collection
formType: afe_collection_table
addFormOptions:
type: \My\BackBundle\Form\Type\Member\EmbedType
allow_add: true
allow_delete: true
by_reference: false
error_bubbling: false
options:
data_class: \My\FrontBundle\Entity\Member
In file "app/cache/dev/Admingenerated/MyBackBundle/Form/BaseTeamType/EditType.php" corresponding lines of code are generated (in "buildForm" method):
$formOptions = $this->getFormOption('members', array( 'required' => false, 'type' => '\\My\\BackBundle\\Form\\Type\\Member\\EmbedType', 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false, 'error_bubbling' => false, 'options' => array( 'data_class' => '\\My\\FrontBundle\\Entity\\Member', ), 'label' => 'label.members', 'translation_domain' => 'Team',));
$builder->add('members', 'afe_collection_table', $formOptions);
Changing the piece of code from: 'type' => '\My\BackBundle\Form\Type\Member\EmbedType'
to: 'type' => new \My\BackBundle\Form\Type\Member\EmbedType()
in forms subclass solves the problem.
Hope, it would help.
This is an admingenerator bug linked to the following issues:
I'll try to push a PR to fix that case.
Hi! I don't now if this bug of AvocodeForm. I have collection upload and all works. Today I start my project in new machine, so I update vendors. And collection upload gives me error
I use last version of avocode with sf 2.3.7. I saw in update log of sf 2.3.7 but I can't find anything there, what can break my code.
And my form: