Skip to content

Fix "payload" usage #9581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2018
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