phiamo / MopaBootstrapBundle

Easy integration of twitters bootstrap into symfony2
http://bootstrap.mohrenweiserpartner.de
711 stars 349 forks source link

Fix crash on rendering prototype for collectionType #1272

Closed SebLevDev closed 3 years ago

SebLevDev commented 3 years ago

Since bump to Symfony 5.1 rendering form with macro generate crash.

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

See the TwigBridge commit : [TwigBridge][Form] Prevent multiple rendering of form collection prototype

    {% macro childPrototype(item) %}
    {{ form(item.quantity) }}
    {% endmacro %}

    {% import _self as macro %}
    {% block content %}
    <script id="childPrototype" type="text/html">
        {{ macro.childPrototype(form.items.vars.prototype) }}
    </script>

    {% for key, item in form.items %}
        {{ macro.childPrototype(item) }}
    {% endfor %}
    {% endbblock %}
deguif commented 3 years ago

@Legenyes could you rebase your branch with master, now that CI is green.

SebLevDev commented 3 years ago

@deguif I do it

deguif commented 3 years ago

Thank you @Legenyes

SebLevDev commented 3 years ago

@deguif Is there a new tag / release planned?

deguif commented 3 years ago

@Legenyes I just release v3.4.1. Enjoy ;)