Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 041e9d2

Browse files
committed
Implement PR suggestions
1 parent 40ede46 commit 041e9d2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

UPGRADE-4.2.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ Form
1616

1717
After:
1818
```twig
19-
{% for field in fieldsWithPotentialDuplicates %}
20-
{% if not field.rendered %}
19+
{% for field in fieldsWithPotentialDuplicates if not field.rendered %}
2120
{{ form_widget(field) }}
22-
{% endif %}
2321
{% endfor %}
2422
```
2523
Security

src/Symfony/Component/Form/FormRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $va
133133

134134
if ($renderOnlyOnce && $view->isRendered()) {
135135
// This is not allowed, because it would result in rendering same IDs multiple times, which is not valid.
136-
@trigger_error(sprintf('You are calling "form_%s" for field "%s" which has already been rendered before. Trying to render fields which were already rendered is deprecated since Symfony 4.2 and will throw an exception in 5.0.', $blockNameSuffix, $view->vars['name']), E_USER_DEPRECATED);
136+
@trigger_error(sprintf('You are calling "form_%s" for field "%s" which has already been rendered before, trying to render fields which were already rendered is deprecated since Symfony 4.2 and will throw an exception in 5.0.', $blockNameSuffix, $view->vars['name']), E_USER_DEPRECATED);
137137
// throw new BadMethodCallException(sprintf('Field "%s" has already been rendered. Save result of previous render call to variable and output that instead.', $view->vars['name']));
138138
return '';
139139
}

0 commit comments

Comments
 (0)