Skip to content

Commit 17b7a59

Browse files
committed
bug symfony#46553 [WebProfilerBundle] normalizer and encoder can be undefined in template (kor3k)
This PR was merged into the 6.1 branch. Discussion ---------- [WebProfilerBundle] normalizer and encoder can be undefined in template | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix symfony#46537 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against the latest branch. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- 18990bf [WebProfilerBundle] normalizer and encoder can be undefined in template
2 parents 940cd74 + 18990bf commit 17b7a59

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@
188188
{% macro render_normalizer_cell(item, index, method) %}
189189
{% set nested_normalizers_id = 'nested-normalizers-' ~ method ~ '-' ~ index %}
190190

191+
{% if item.normalizer is defined %}
191192
<span class="nowrap"><a href="{{ item.normalizer.file|file_link(item.normalizer.line) }}" title="{{ item.normalizer.file }}">{{ item.normalizer.class }}</a> ({{ '%.2f'|format(item.normalizer.time * 1000) }} ms)</span>
193+
{% endif %}
192194

193195
{% if item.normalization|length > 1 %}
194196
<div>
@@ -207,7 +209,9 @@
207209
{% macro render_encoder_cell(item, index, method) %}
208210
{% set nested_encoders_id = 'nested-encoders-' ~ method ~ '-' ~ index %}
209211

212+
{% if item.encoder is defined %}
210213
<span class="nowrap"><a href="{{ item.encoder.file|file_link(item.encoder.line) }}" title="{{ item.encoder.file }}">{{ item.encoder.class }}</a> ({{ '%.2f'|format(item.encoder.time * 1000) }} ms)</span>
214+
{% endif %}
211215

212216
{% if item.encoding|length > 1 %}
213217
<div>

0 commit comments

Comments
 (0)