8000 Fix "payload" usage by liviubalan · Pull Request #9581 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions validation/severity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ so that the severity is added as an additional HTML class:
{%- if errors|length > 0 -%}
<ul>
{%- for error in errors -%}
{% if error.cause.constraint.payload.severity is defined %}
{% set severity = error.cause.constraint.payload.severity %}
{% if error.constraint.payload.severity is defined %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like the wrong fix to me. The previous paragraph is talking about the form_errors block. Thus, we can assume that errors is an array of FormErrror instances where there is no $constraint property, but indeed a $cause.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #9631

{% set severity = error.constraint.payload.severity %}
{% endif %}
<li{% if severity is defined %} class="{{ severity }}"{% endif %}>{{ error.message }}</li>
{%- endfor -%}
Expand Down
0