I am using sonata admin bundle to manage our class and I am creating the test with behat to be sure that everything is working fine.
But the problem is that when I try to add a new element using behat I get this error:
When I visit the advertisement admin page
And I follow "Add new"
And I fill in "Url" with "http://www.example.com"
And I fill in "Video Source" with "http://www.youtube.com"
And I fill in "Text" with "Test new"
And I press "Create and return to list"
The selected node does not have a form ancestor.
The problem is because this button is out of the form but this is managed by sonata admin.
So is there any way to click this button without get this error?
The problem with sonata was that I have this element in the form and it seems that create an incorrect form :
->add('image', 'sonata_type_model_autocomplete', ['required' => false, 'property' => 'name']);
I change for this one and right now is working:
->add('image', 'sonata_type_model_list', ['required' => false]);