Closed anboo closed 6 years ago
I have the same problem. In my case the Admin generated that error when the form was done like this:
protected function configureFormFields(FormMapper $formMapper)
...
if ($this->isCurrentRoute('edit')) {
$formMapper->add('something', 'sonata_type_collection',
array('required' => false, 'by_reference' => false),
array('edit' => 'inline', 'inline' => 'table')
);
}
If its out of the route check, it works..
Why does this issue belongs to the Userbundle?
It does not.. I just googled the error and found this
@haivala did you ever find a way of using the route check as you showed? I am having the same issue, this is the only thread i found with the exact same problem i am facing. Thanks!
Try updating admin bundle to the latest version, and probably all the other sonata bundles too.
Closing because this does not belong to user-bundle.
I have the same problem. In my case the Admin generated that error when the form was done like this:
protected function configureFormFields(FormMapper $formMapper) ... if ($this->isCurrentRoute('edit')) { $formMapper->add('something', 'sonata_type_collection', array('required' => false, 'by_reference' => false), array('edit' => 'inline', 'inline' => 'table') ); }
If its out of the route check, it works..
This makes it work if($this->isCurrentRoute('edit') || $this->getRequest()->get('_route') === 'sonata_asadmin_append_form_element'))
Environment
Sonata packages
Symfony packages
PHP version
Subject
Steps to reproduce
HouseAdmin.php:
ImageAdmin.php:
House.php:
Image.php:
Expected results
Correct, without errors :)
Actual results
Incorrect froms :)