8000 bug #25678 [WebProfilerBundle] set the var in the right scope (Jochen… · symfony/symfony@85240f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 85240f2

Browse files
committed
bug #25678 [WebProfilerBundle] set the var in the right scope (Jochen Mandl)
This PR was squashed before being merged into the 3.4 branch (closes #25678). Discussion ---------- [WebProfilerBundle] set the var in the right scope | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - ![2018-01-04 um 09 29 54](https://user-images.githubusercontent.com/1322118/34555989-de6fd11c-f134-11e7-81f7-9b840a946073.png) This PR fixes the bug when displaying the toolbar. The variable "has_time_events" was not created in the scope of the toolbar. Commits ------- 3e9780d [WebProfilerBundle] set the var in the right scope
2 parents 837ec4d + 3e9780d commit 85240f2

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
} %}
1515
{% endif %}
1616

17-
{% set has_time_events = collector.events|length > 0 %}
1817

1918
{% block toolbar %}
19+
{% set has_time_events = collector.events|length > 0 %}
20+
2021
{% set total_time = has_time_events ? '%.0f'|format(collector.duration) : 'n/a' %}
2122
{% set initialization_time = collector.events|length ? '%.0f'|format(collector.inittime) : 'n/a' %}
2223
{% set status_color = has_time_events and collector.duration > 1000 ? 'yellow' : '' %}
@@ -49,6 +50,7 @@
4950
{% endblock %}
5051

5152
{% block panel %}
53+
{% set has_time_events = collector.events|length > 0 %}
5254
<h2>Performance metrics</h2>
5355

5456
<div class="metrics">

0 commit comments

Comments
 (0)
0