bug #22928 [WebProfilerBundle] Fixed options stub values display in form profiler (HeahDude)

This PR was merged into the 3.3 branch.

Discussion
----------

[WebProfilerBundle] Fixed options stub values display in form profiler

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Since 3.3 and #21638, serializing form options gives either a `CutStub` instance or a simple var, ref ab716c64de (diff-78ea21636d0319e1c804ccc1a33f68f3R271).

This breaks the form profiler panel.

Commits
-------

5e6b3a5 Fixed options stub values display in form profiler
This commit is contained in:
Nicolas Grekas 2017-05-28 11:23:46 +02:00
commit df7fe489bb

View File

@ -624,7 +624,10 @@
<th>{{ option }}</th>
<td>{{ profiler_dump(value) }}</td>
<td>
{% if data.resolved_options[option] == value %}
{# values can be stubs #}
{% set option_value = value.value|default(value) %}
{% set resolved_option_value = data.resolved_options[option].value|default(data.resolved_options[option]) %}
{% if resolved_option_value == option_value %}
<em class="font-normal text-muted">same as passed value</em>
{% else %}
{{ profiler_dump(data.resolved_options[option]) }}