sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

ModelType dont wor'k #7058

Closed epci closed 3 years ago

epci commented 3 years ago

Hello,

When i try to use Sonata\AdminBundle\Form\Type\ModelType

I have an error "An exception has been thrown during the rendering of a template ("Field "FIELDS" has already been rendered, save the result of previous render call to a variable and output that instead.")."

thank you

VincentLanglet commented 3 years ago

Hello

There is a bug template, please fill it with all the necessary information or no help can't be provided and this issue will be closed.

Thanks you

epci commented 3 years ago

Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Field "groups" has already been rendered, save the result of previous render call to a variable and output that instead.")." at /srv/users/serverpilot/apps/tools-starter5/vendor/sonata-project/admin-bundle/src/Resources/views/CRUD/Association/edit_many_to_many.html.twig line 110 { "exception": {} }

epci commented 3 years ago

An exception has been thrown during the rendering of a template ("Field "groups" has already been rendered, save the result of previous render call to a variable and output that instead."). Exceptions 2 Logs 1 Stack Traces 2 Twig\Error\ RuntimeError in vendor/sonata-project/admin-bundle/src/Resources/views/CRUD/Association/edit_many_to_many.html.twig (line 110) {% include '@SonataAdmin/CRUD/Association/edit_one_script.html.twig' %} {% else %}

{{ form_widget(form) }} {% if sonata_admin.field_description.associationadmin.hasRoute('create') and sonata_admin.field_description.associationadmin.hasAccess('create')

VincentLanglet commented 3 years ago

I'm talking about the following bug template. I'm sorry but without these information, the issue will be closed.

Environment

Sonata packages

show

``` $ composer show --latest 'sonata-project/*' # Put the result here. ```

Symfony packages

show

``` $ composer show --latest 'symfony/*' # Put the result here. ```

PHP version

$ php -v
# Put the result here.

Subject

Minimal repository with the bug

Steps to reproduce

Expected results

Actual results