Skip to content

Commit 0439abb

Browse files
bug symfony#20860 [WebProfilerBundle] Fix a web profiler form issue with fields added to the form after the form was built (tgalopin)
This PR was merged into the 3.2 branch. Discussion ---------- [WebProfilerBundle] Fix a web profiler form issue with fields added to the form after the form was built | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#20823 | License | MIT | Doc PR | - I discovered a bug in 3.2 in the web profiler and this PR fixes it. This issue has been fixed in the past by symfony#13166 and probably reintroduced by the refactoring we did in the WebProfiler in 3.2. I simply applied the fix to these changes. To reproduce the original problem, simply clone the current standard edition, create a Form with a Type and add a field after its creation. Once done, try to access the Webprofiler: it will fails with the following error: > Key "type_class" for array with keys "id, name, view_vars, children" does not exist in @WebProfiler/Collector/form.html.twig at line 460. Commits ------- d9af8e9 Fix a web profiler form issue with fields added to the form after the form was built
2 parents fef1546 + d9af8e9 commit 0439abb

File tree

1 file changed

+1
-1
lines changed
  • src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector

1 file changed

+1
-1
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@
457457
{% import _self as tree %}
458458
<div class="tree-details{% if not show|default(false) %} hidden{% endif %}" {% if data.id is defined %}id="{{ data.id }}-details"{% endif %}>
459459
<h2 class="dump-inline">
460-
{{ name|default('(no name)') }} ({{ profiler_dump(data.type_class) }})
460+
{{ name|default('(no name)') }} {% if data.type_class is defined %}({{ profiler_dump(data.type_class) }}){% endif %}
461461
</h2>
462462

463463
{% if data.errors is defined and data.errors|length > 0 %}

0 commit comments

Comments
 (0)