From 92fff611ef10677f5c7e2cea63cdfb8cf6fe564f Mon Sep 17 00:00:00 2001 From: Alexander Blanchard Date: Mon, 7 Apr 2025 10:24:22 +0000 Subject: [PATCH] Bug 39547: Required Fields Not Conveyed An accessibility audit highlighted that the Personal Details form uses required in red text to indicate when a field is required but this is not also conveyed programmatically for users with screen readers. To test: 1) On Koha's staff site, naviagte to Administration 2) Add surname to PatronSelfModificationMandatoryField 3) On the oPac, navigate to Home > Koha > Your Personal Details 4) Notice that under surname there is red text that reads 'required' 5) Right click and inspect the Surname input 6) Notice that the input field does not have a required attribute 7) Apply the patch 8) Repeat the steps above 9) Notice that on inspect, the required attribute is now present 10) Navigate back to the staff site and to Administration 11) Remove Surname from PatronSelfModificationMandatoryField 12) Navigate back to the oPac Home > Koha > Your Personal Details and refresh 13) Inspect the Surname element and notice that the required attribute is gone 14) The same behaviour should be present for all form elements Signed-off-by: Brendan Gallagher Signed-off-by: Martin Renvoize --- .../bootstrap/en/modules/opac-memberentry.tt | 240 +++++++++++++++--- 1 file changed, 198 insertions(+), 42 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index 7b3c9895fbf..35456b194bf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -405,7 +405,7 @@
  • - +
    Required
  • [% END %] @@ -414,7 +414,14 @@
  • - +
    Required
  • [% END %] @@ -423,7 +430,14 @@
  • - +
    Required
  • [% END %] @@ -432,7 +446,14 @@
  • - +
    Required
  • [% END %] @@ -441,7 +462,15 @@
  • - +
    Required
  • @@ -451,7 +480,14 @@
  • - +
    Required
  • [% END %] @@ -460,7 +496,14 @@
  • - +
    Required
  • [% END %] @@ -469,7 +512,14 @@
  • - +
    Required
  • [% END %] @@ -538,7 +588,7 @@
  • - [% FOR roadtype IN roadtypes %] [% IF roadtype.authorised_value == patron.streettype %] @@ -557,7 +607,7 @@
  • - +
    Required
  • [% END %] @@ -568,7 +618,14 @@
  • - +
    Required
  • [% END %] @@ -577,7 +634,7 @@
  • - +
    Required
  • [% END %] @@ -586,7 +643,7 @@
  • - +
    Required
  • [% END %] @@ -595,7 +652,7 @@
  • - +
    Required
  • [% END %] @@ -604,7 +661,7 @@
  • - +
    Required
  • [% END %] @@ -629,7 +686,7 @@
  • - +
    Required
  • [% END %] @@ -638,7 +695,14 @@
  • - +
    Required
  • [% END %] @@ -647,7 +711,7 @@
  • - +
    Required
  • [% END %] @@ -656,7 +720,7 @@
  • - +
    Required
  • @@ -664,7 +728,7 @@
  • - +
    Required
  • [% END %] @@ -674,7 +738,14 @@
  • - +
    Required
  • [% END %] @@ -683,7 +754,7 @@
  • - +
    Required
  • [% END %] @@ -696,7 +767,7 @@ [% END %] - [% UNLESS hidden.defined('phone') %] [% IF ( borrower.primary_contact_method == 'phone' ) %] @@ -750,7 +821,7 @@ [% ELSE %] [% END %] - [% FOR language IN languages %] [% FOR sublanguage IN language.sublanguages_loop %] @@ -806,7 +877,7 @@
  • - [% FOR roadtype IN roadtypes %] [% IF roadtype.authorised_value == patron.streettype %] @@ -824,7 +895,14 @@
  • - +
    Required
  • [% END %] @@ -835,7 +913,14 @@
  • - +
    Required
  • [% END %] @@ -844,7 +929,7 @@
  • - +
    Required
  • [% END %] @@ -853,7 +938,7 @@
  • - +
    Required
  • [% END %] @@ -862,7 +947,14 @@
  • - +
    Required
  • [% END %] @@ -871,7 +963,14 @@
  • - +
    Required
  • [% END %] @@ -880,7 +979,7 @@
  • - +
    Required
  • [% END %] @@ -889,14 +988,14 @@
  • - +
    Required
  • [% END %] [% UNLESS hidden.defined('contactnote') %]
  • - +
    Required
    @@ -923,7 +1022,14 @@
  • - +
    Required
  • [% END %] @@ -938,6 +1044,7 @@ name="borrower_altcontactfirstname" value="[% borrower.altcontactfirstname | html %]" class="[% required.altcontactfirstname | html %]" + [% IF required.altcontactfirstname %]required[% END %] />
    Required
    @@ -947,7 +1054,14 @@
  • - +
    Required
  • [% END %] @@ -956,7 +1070,14 @@
  • - +
    Required
  • [% END %] @@ -965,7 +1086,14 @@
  • - +
    Required
  • [% END %] @@ -974,7 +1102,14 @@
  • - +
    Required
  • [% END %] @@ -983,7 +1118,14 @@
  • - +
    Required
  • [% END %] @@ -992,7 +1134,14 @@
  • - +
    Required
  • [% END %] @@ -1001,7 +1150,14 @@
  • - +
    Required
  • [% END %] -- 2.49.0