10000 bug #29527 [TwigBridge][Form] Prevent multiple rendering of form coll… · symfony/symfony@153220a · GitHub
[go: up one dir, main page]

Skip to content

Commit 153220a

Browse files
bug #29527 [TwigBridge][Form] Prevent multiple rendering of form collection prototypes (Shoplifter)
This PR was merged into the 3.4 branch. Discussion ---------- [TwigBridge][Form] Prevent multiple rendering of form collection prototypes | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #29489 <!-- #-prefixed issue number(s), if any --> | License | MIT prevents attemt to render of prototype in CollectionType when it has been rendered already. (see [Deprecated calling FormRenderer::searchAndRenderBlock for fields which were already rendered.](https://github.com/symfony/symfony/blob/master/UPGRADE-4.2.md#form)) Commits ------- ffd2722 [TwigBridge][Form] Prevent multiple rendering of form collection prototypes
2 parents 3096665 + ffd2722 commit 153220a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{%- endblock form_widget_compound -%}
2525

2626
{%- block collection_widget -%}
27-
{% if prototype is defined %}
27+
{% if prototype is defined and not prototype.rendered %}
2828
{%- set attr = attr|merge({'data-prototype': form_row(prototype) }) -%}
2929
{% endif %}
3030
{{- block('form_widget') -}}

0 commit comments

Comments
 (0)
0