From 1de01f511cb5f72edb180a657f1211f4655d5a05 Mon Sep 17 00:00:00 2001 From: Gareth Trinkwon Date: Fri, 9 Jan 2026 16:05:07 +0000 Subject: [PATCH 1/7] Fixed incorrect help and error IDs to match aria-describedby values. --- src/Resources/views/Form/accessible-forms.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Resources/views/Form/accessible-forms.html.twig b/src/Resources/views/Form/accessible-forms.html.twig index 350039a..2e78aa5 100644 --- a/src/Resources/views/Form/accessible-forms.html.twig +++ b/src/Resources/views/Form/accessible-forms.html.twig @@ -25,7 +25,7 @@ {%- block form_errors -%} {%- if errors|length > 0 -%} {% for error in errors %} - Error: {{ error.message }} + Error: {{ error.message }} {% endfor %} {%- endif -%} {%- endblock form_errors -%} @@ -96,7 +96,7 @@ {# Custom markup for field hints #} {% block form_help -%} {%- if help -%} -
+
{{- block('form_help_content') -}}
{%- endif -%} From 553731e2504ef856fa2b13f03dd6989c66383c24 Mon Sep 17 00:00:00 2001 From: Gareth Trinkwon Date: Fri, 9 Jan 2026 16:49:16 +0000 Subject: [PATCH 2/7] fix: Fixed incorrect help and error IDs to match aria-describedby values. From cad83d3fdede0453ae54f69e653f6ab3fb1967e7 Mon Sep 17 00:00:00 2001 From: Gareth Trinkwon Date: Fri, 9 Jan 2026 17:18:04 +0000 Subject: [PATCH 3/7] Updated required label to be an asterisk. Added prefix block to render before form start. --- src/Resources/views/Form/accessible-forms.html.twig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Resources/views/Form/accessible-forms.html.twig b/src/Resources/views/Form/accessible-forms.html.twig index 2e78aa5..2e9a01a 100644 --- a/src/Resources/views/Form/accessible-forms.html.twig +++ b/src/Resources/views/Form/accessible-forms.html.twig @@ -1,6 +1,11 @@ {# Extends vendor/symfony/twig-bridge/Resources/views/Form/form_div_layout.html.twig #} {% use 'form_div_layout.html.twig' %} +{# Custom block that gets included prior to form_start #} +{% block form_prefix %} +

Fields marked * are required.

+{% endblock %} + {# Custom block to list errors #} {%- block form_error_summary -%} {% if form is not valid %} @@ -33,6 +38,7 @@ {# Add class to form start #} {%- block form_start -%} {% set attr = attr|merge({'class': 'tbxforms'}) %} + {{- block('form_prefix') -}} {{- parent() -}} {%- endblock form_start -%} @@ -50,7 +56,7 @@ {%- block form_label -%} {% if label is not same as(false) -%} {%- if compound -%} -

{{- block('form_label_content') -}}{% if required %} (required){% endif %}

+

{{- block('form_label_content') -}}{% if required %} *{% endif %}

{%- else -%} {% if not compound -%} {% set label_attr = label_attr|merge({for: id}) %} @@ -58,7 +64,7 @@ {% set label_attr = label_attr|merge({'class': 'rnib-form-label'}) %}

- {{- block('form_label_content') -}}{% if required %} (required){% endif %} + {{- block('form_label_content') -}}{% if required %} *{% endif %}

{%- endif -%} From f5333cb1b35bbdc392e7c54fc7232a6df46566f2 Mon Sep 17 00:00:00 2001 From: Gareth Trinkwon Date: Wed, 14 Jan 2026 11:25:29 +0000 Subject: [PATCH 4/7] Restored required text to label, but removed required from widget attribute to prevent frontend validation. --- src/Resources/views/Form/accessible-forms.html.twig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Resources/views/Form/accessible-forms.html.twig b/src/Resources/views/Form/accessible-forms.html.twig index 2e9a01a..7e77e15 100644 --- a/src/Resources/views/Form/accessible-forms.html.twig +++ b/src/Resources/views/Form/accessible-forms.html.twig @@ -56,7 +56,7 @@ {%- block form_label -%} {% if label is not same as(false) -%} {%- if compound -%} -

{{- block('form_label_content') -}}{% if required %} *{% endif %}

+

{{- block('form_label_content') -}}{% if required %} (required){% endif %}

{%- else -%} {% if not compound -%} {% set label_attr = label_attr|merge({for: id}) %} @@ -64,7 +64,7 @@ {% set label_attr = label_attr|merge({'class': 'rnib-form-label'}) %}

- {{- block('form_label_content') -}}{% if required %} *{% endif %} + {{- block('form_label_content') -}}{% if required %} (required){% endif %}

{%- endif -%} @@ -212,3 +212,10 @@ {% endif %} {% endblock birthday_widget %} + +{%- block widget_attributes -%} + id="{{ id }}" name="{{ full_name }}" + {%- if disabled %} disabled="disabled"{% endif -%} + {%- if required %} required="required"{% endif -%} + {{ block('attributes') }} +{%- endblock widget_attributes -%} From 1b94269fa1b59d4b18a1932469bbe47bd04b409c Mon Sep 17 00:00:00 2001 From: Gareth Trinkwon Date: Wed, 14 Jan 2026 13:54:49 +0000 Subject: [PATCH 5/7] Fixed missing change from widget_attributes override. --- .../views/Form/accessible-forms.html.twig | 68 ++++++++++--------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/src/Resources/views/Form/accessible-forms.html.twig b/src/Resources/views/Form/accessible-forms.html.twig index 7e77e15..d950e48 100644 --- a/src/Resources/views/Form/accessible-forms.html.twig +++ b/src/Resources/views/Form/accessible-forms.html.twig @@ -3,26 +3,26 @@ {# Custom block that gets included prior to form_start #} {% block form_prefix %} -

Fields marked * are required.

+

Fields marked * are required.

{% endblock %} {# Custom block to list errors #} {%- block form_error_summary -%} {% if form is not valid %} -