Skip to content

Commit

Permalink
bug #29527 [TwigBridge][Form] Prevent multiple rendering of form coll…
Browse files Browse the repository at this point in the history
…ection 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
  • Loading branch information
nicolas-grekas committed Dec 12, 2018
2 parents 3096665 + ffd2722 commit 153220a
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -24,7 +24,7 @@
{%- endblock form_widget_compound -%}

{%- block collection_widget -%}
{% if prototype is defined %}
{% if prototype is defined and not prototype.rendered %}
{%- set attr = attr|merge({'data-prototype': form_row(prototype) }) -%}
{% endif %}
{{- block('form_widget') -}}
Expand Down

0 comments on commit 153220a

Please sign in to comment.