Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 410b597

Browse filesBrowse files
committed
Fix panel break when stopwatch component is not installed.
1 parent 77104a1 commit 410b597
Copy full SHA for 410b597

File tree

Expand file treeCollapse file tree

1 file changed

+12
-6
lines changed
Filter options
  • src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector
Expand file treeCollapse file tree

1 file changed

+12
-6
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig
+12-6Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
} %}
1515
{% endif %}
1616

17+
{% set has_time_events = collector.events|length > 0 %}
18+
1719
{% block toolbar %}
18-
{% set total_time = collector.events|length ? '%.0f'|format(collector.duration) : 'n/a' %}
20+
{% set total_time = has_time_events ? '%.0f'|format(collector.duration) : 'n/a' %}
1921
{% set initialization_time = collector.events|length ? '%.0f'|format(collector.inittime) : 'n/a' %}
20-
{% set status_color = collector.events|length and collector.duration > 1000 ? 'yellow' : '' %}
22+
{% set status_color = has_time_events and collector.duration > 1000 ? 'yellow' : '' %}
2123

2224
{% set icon %}
2325
{{ include('@WebProfiler/Icon/time.svg') }}
@@ -75,10 +77,14 @@
7577
<span class="label">Sub-Request{{ profile.children|length > 1 ? 's' }}</span>
7678
</div>
7779

78-
{% set subrequests_time = 0 %}
79-
{% for child in profile.children %}
80-
{% set subrequests_time = subrequests_time + child.getcollector('time').events.__section__.duration %}
81-
{% endfor %}
80+
{% if has_time_events %}
81+
{% set subrequests_time = 0 %}
82+
{% for child in profile.children %}
83+
{% set subrequests_time = subrequests_time + child.getcollector('time').events.__section__.duration %}
84+
{% endfor %}
85+
{% else %}
86+
{% set subrequests_time = 0 %}
87+
{% endif %}
8288

8389
<div class="metric">
8490
<span class="value">{{ subrequests_time }} <span class="unit">ms</span></span>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.