Bug 40283

Summary: Accessibility of the status message in the OPAC
Product: Koha Reporter: Nina Martinez <nina.martinez>
Component: AccessibilityAssignee: Nina Martinez <nina.martinez>
Status: Signed Off --- QA Contact: Aleisha Amohia <aleisha>
Severity: trivial    
Priority: P5 - low CC: aleisha, julian.maurice, martin.renvoize, matt.blenkinsop, oleonard
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 26038    
Attachments: Bug 40283: discharge page
Bug 40283: Change password page (opac-passwd)
Bug 40283: Placing a hold page.
Bug 40283: Messaging page.
Bug 40283: Consent page.
Bug 40283: Article request page.
Bug 40283: Your summary page.
Bug 40283: Course reserves page.
Bug 40283: memberentry page.
Bug 40283: Privacy page.
Bug 40283: Change password page (opac-passwd)
Bug 40283: Report Problem page.
Bug 40283: Lists page.
Bug 40283: Share List page.
Bug 40283: discharge page
Bug 40283: Placing a hold page.
Bug 40283: Messaging page.
Bug 40283: Consent page.
Bug 40283: Article request page.
Bug 40283: Your summary page.
Bug 40283: Course reserves page.
Bug 40283: memberentry page.
Bug 40283: Privacy page.
Bug 40283: Change password page (opac-passwd)
Bug 40283: Report Problem page.
Bug 40283: Lists page.
Bug 40283: Share List page.

Description Nina Martinez 2025-07-01 13:29:38 UTC
The intent of this success criterion is to make users aware of important changes in content that are not given focus, and to do so in a way that doesn't unnecessarily interrupt their work.
https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html


To improve this, we can add role=”status” or role=”alert” in the message tag.

Using the status role from the ARIA specification to notify Assistive Technologies (AT) when content has been updated with information about the user's or application's status.
https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA22


The purpose of the role=”alert” is to notify Assistive Technologies (AT) when an input error occurs. The role=”alert”attribute makes it possible for an AT (such as a screen reader) to be notified when error messages
Comment 1 Nina Martinez 2025-07-01 14:24:49 UTC
Created attachment 183665 [details] [review]
Bug 40283: discharge page

This patch add role="status" or role="alert" to the message tag of the opac-discharge page.

Test plan:

1- Enable the system preference: UseDischarge
2- Log in to a patron account with items check out, or make checkout
3- Go to "Ask for discharge", there should be a message: "You cannot be discharged because: ..." Inspect the html code, and notice that there is a role="alert" in the message tag.
4- Check in all the items or log in to a new patron account without items checked out, and click on "Ask for discharge". You should see the button "Ask for a discharge", click on it, and a message should appear. Inspect in the html if there is a role="status" in the message tag.
Comment 2 Nina Martinez 2025-07-01 14:31:47 UTC Comment hidden (obsolete)
Comment 3 Nina Martinez 2025-07-01 14:43:44 UTC
Created attachment 183667 [details] [review]
Bug 40283: Placing a hold page.

Test plan:

1. Research a record and choose one, then place a hold on it. Try to place the hold twice. A message should appear: 'You already have at least one ... holds must be at the record level.' Inspect the HTML code and notice that there is a role='alert' in the message tag

2. Go to the Staff interface, then in Koha administration, click on 'Circulation and fine rules.' Determine the number of holds allowed. Log in to a patron account and place holds to reach the limit. Try to exceed the limit. A message should appear: 'This title cannot be requested because you have reached the maximum number of holds.' Inspect the HTML code and notice that there is a role='alert' in the message tag.
Comment 4 Nina Martinez 2025-07-01 14:50:56 UTC
Created attachment 183668 [details] [review]
Bug 40283: Messaging page.

This patch add role="status" in the message tag of the Messaging page (opac-messaging)

Test plan:

1. Enable the following preference system: EnhancedMessagingPreferencesOPAC and TranslateNotices
2. Log in to a patron account and click on messaging in the user menu. Change your messaging settings/ A message should appear "Settings updated". Inspect the html code and notice that there is a role='status' in the message tag.
Comment 5 Nina Martinez 2025-07-01 14:58:22 UTC
Created attachment 183669 [details] [review]
Bug 40283: Consent page.

This patch add role='status' to the message tag of the consent page (opac-patron-page)

Test plan:

1. Enable the system preference: PrivacyPolicyConsent
2. Log in to a patron account. Go to the 'Consent' page, Change your consent twice. If you save Yes, the message should be: "Your consent was registered on 'date'" and if you save no: "We registered that you did not consent on 'date'". Inscpect each time the html code and notice that there is a role='status' in the message tag.
Comment 6 Nina Martinez 2025-07-01 15:10:43 UTC
Created attachment 183670 [details] [review]
Bug 40283: Article request page.

Test plan:

1- Enable the system preference: ArticleRequests.
2- Go to Circulation and Rules in the staff interface (in the Administration page, click on Circulation and Rules) and set an article request limit.
3- Reach your article requests limit, a message should appear. Inspect the HTML code and notice that there is a role="alert" in the message tag.
4- Go back to Circulation an dRules in the staff interface and choose "No" for  "Article requests". Try to male an article request, a message should appear. Inspect the html and notice that there si a role="alert".
Comment 7 Nina Martinez 2025-07-01 15:24:01 UTC
Created attachment 183671 [details] [review]
Bug 40283: Your summary page.

This patch add role="status" and role="alert" to the Summary page. (opac-user)

Test plan:

1- Enable the system preference OpacReportProblem. If you have a checkout record, add a note. A message should appear: "Your note about ...". Inspect the html code and notice that there is a role="status" in the message tag.
2- Create a new patron account with a card expiration date set to tomorrow. Go to the OPAC, log in to this patron account? You should notice on your summary page a message: "Your library card will expire on ...". Inspect the html code and notice that there is a role="alert" in the message tag.
3- Go to the staff interface, patron details, and change the card expiration date to yesterday. Go back to the OPAC and you should now have the message: "Your account has expired as of...".
4-Go to the staff interface, choose your patron, click on more, and choose discharge.
5-Go back to the OPAC, log in to this patron account, and a message should appear: "Your account is frozen because it has been discharged." Inspect the HTML code and notice that there is a role='alert' in the message tag.
Comment 8 Nina Martinez 2025-07-01 15:29:46 UTC
Created attachment 183672 [details] [review]
Bug 40283: Course reserves page.

Test plan:

1- Enable the system preference: UseCourseReserve.
2- Go to the Course Reserves page, click on the name of the course. Inspect the html code of the message: "No reserves have been selected for this courses", and notice that there is a role="status" in the tag.
Comment 9 Nina Martinez 2025-07-01 15:35:11 UTC
Created attachment 183673 [details] [review]
Bug 40283: memberentry page.

Added Alert and status role to the messages tags.

Test plan:

1- Enable the system preference: OPACPatronDetails
2- Log in to an adult patron account, go to Personal details
3- Without making any changes, click on "submit update request", the alert message should be : 'No changes were made', Inspect the HTML code, and notice that there is a role='alert' in the message tag.
4- Change your date of birth to today and submit
5- An error message should appear: "The following fields contain invalid information ... Patron's  age ... correct and resubmit". Inspect the HTML code and notice that there is a role='alert' in the message tag.
6- Add or change an information, and submit the update. A message should appear: 'Thank you ... ' Inspect the HTML code, and notice that there is a role='status'.
7- Now disable the system preference OPACPatronDetails. The status message should be: 'To make changes to your record, please contact the library'. Inspect the HTML code, and notice that there is a role='status' in the message tag.
8- Now log out, click on create a new account, fill the required fields, and fail the captcha? You should see the error message: 'You typed the wrong ... Please try again.' Inspect the HTML code, and notice that there is a role='alert' in the message tag.
Comment 10 Nina Martinez 2025-07-01 15:39:34 UTC
Created attachment 183674 [details] [review]
Bug 40283: Privacy page.

Test plan:

1- Enable the system preferences: OPACPrivacy, OPACHoldsHistory.
2- Change your privacy rule to "forever" or "default" and save. A message should appear: "Your privacy rules have been updated." Inspect the HTML code and notice that there is a role="status" in the message tag.
3- Change your privacy rule to "Never." A message should appear: "This option will delete all previous checkout history immediately." Inspect the HTML code and notice that there is a role="alert" in the message tag.
4- Check if you have a checkout in your checkout history. If you don't, make a checkout.
5- Click on "Delete checkout history." If you have a checkout history, the message is: "Your checkout history has been deleted." Inspect the HTML code and notice that there is a role="status" in the message tag.
6- Click again on the "Delete checkout history" button; the error message should appear:"No hold history to delete." Inspect the HTML code and notice that there is a role="alert" in the message tag.
7- Check if you have a hold in your holds history. If you don't, place a hold on a record.
8- Repeat step 5 with the "Delete hold history" button. A message should appear: "Your holds history has been deleted." Inspect the HTML code and notice that there is a role="status" in the message tag.
9- Repeat step 6 with the "Delete hold history" button.
Comment 11 Owen Leonard 2025-07-01 18:57:03 UTC
opac-passwd.tt includes the addition of 'status="alert"' which I assume is a typo?
Comment 12 Nina Martinez 2025-07-02 07:31:30 UTC
Created attachment 183683 [details] [review]
Bug 40283: Change password page (opac-passwd)

Test plan:

1. Enable the system preference: OpacPasswordChange, RequireStrongPassword
2. Log in to a Patron account, choose "Change Password". A message should appear "You password must contain ... and numbers.". Inspect the html code and notice that there is a role="alert" in the message tag.
3. Enter an incorrect current password and a new password, then submit. A message should appear "Your current password was ... to reset your password for you". Inspect the html code, and notice that there is a role="alert" in the message tag.
4. Enter your current password, change it to a new one, and confirm. A message should appear "Your password has been changed.". Inspect the html code, and notice that there is a role="status" in the message tag.
5. Go to the Staff interface. Don't allow the system preference: OpacPasswordChange. Go back to the OPAC, refresh the page: opac-passwd.pl
A message should appear "You can't change your password". Inspect the html code and notice that there is a role='alert' in the message tag.
Comment 13 Nina Martinez 2025-07-02 07:34:01 UTC
(In reply to Owen Leonard from comment #11)
> opac-passwd.tt includes the addition of 'status="alert"' which I assume is a
> typo?

Thank you Owen, I corrected !
Comment 14 Nina Martinez 2025-07-02 07:50:21 UTC
Created attachment 183684 [details] [review]
Bug 40283: Report Problem page.

Test plan:

1. Allow the system preference: OPACReportProblem, and entry an email in ReplytoDefault
2. Log in to a patron account.
3. Try to send a problem to a librarian. A message of confirmation should appear: "Your problem report has been sent to the library". Inspect the html code and notice that there is a role="status" in the message tag.
4. Remake step 3 but with a Koha administrator.
Comment 15 Nina Martinez 2025-07-02 08:03:19 UTC
Created attachment 183685 [details] [review]
Bug 40283: Lists page.

Test plan:

1- Enable the system preference: virtualshelves
2- Create a "New list", two messages should appear "List created" and "This list is empty... ", inspect the html code of "This list is empty ... " and notice that there is a role="status"
Comment 16 Nina Martinez 2025-07-02 08:16:16 UTC
Created attachment 183686 [details] [review]
Bug 40283: Share List page.

Test plan:

1- Enable the system preference: OpacAllowSharingPrivateLists.
2- Try to share the private list and enter an incorrect email format, a message should appear: "Sorry, but you did not enter a valid email adress."
Comment 17 Owen Leonard 2025-07-02 12:40:39 UTC
Created attachment 183689 [details] [review]
Bug 40283: discharge page

This patch add role="status" or role="alert" to the message tag of the
opac-discharge page.

Test plan:

1- Enable the system preference: UseDischarge
2- Log in to a patron account with items check out, or make checkout
3- Go to "Ask for discharge", there should be a message: "You cannot be
   discharged because: ..." Inspect the html code, and notice that there
   is a role="alert" in the message tag.
4- Check in all the items or log in to a new patron account without
   items checked out, and click on "Ask for discharge". You should see
   the button "Ask for a discharge", click on it, and a message should
   appear. Inspect in the html if there is a role="status" in the
   message tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 18 Owen Leonard 2025-07-02 12:40:41 UTC
Created attachment 183690 [details] [review]
Bug 40283: Placing a hold page.

Test plan:

1. Research a record and choose one, then place a hold on it. Try to
   place the hold twice. A message should appear: 'You already have at
   least one ... holds must be at the record level.' Inspect the HTML
   code and notice that there is a role='alert' in the message tag

2. Go to the Staff interface, then in Koha administration, click on
   'Circulation and fine rules.' Determine the number of holds allowed.
   Log in to a patron account and place holds to reach the limit. Try
   to exceed the limit. A message should appear: 'This title cannot be
   requested because you have reached the maximum number of holds.'
   Inspect the HTML code and notice that there is a role='alert' in the
   message tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 19 Owen Leonard 2025-07-02 12:40:44 UTC
Created attachment 183691 [details] [review]
Bug 40283: Messaging page.

This patch add role="status" in the message tag of the Messaging page
(opac-messaging)

Test plan:

1. Enable the following preference system:
   EnhancedMessagingPreferencesOPAC and TranslateNotices
2. Log in to a patron account and click on messaging in the user menu.
   Change your messaging settings/ A message should appear "Settings
   updated". Inspect the html code and notice that there is a
   role='status' in the message tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 20 Owen Leonard 2025-07-02 12:40:47 UTC
Created attachment 183692 [details] [review]
Bug 40283: Consent page.

This patch add role='status' to the message tag of the consent page
(opac-patron-page)

Test plan:

1. Enable the system preference: PrivacyPolicyConsent
2. Log in to a patron account. Go to the 'Consent' page, Change your
   consent twice. If you save Yes, the message should be: "Your consent
   was registered on 'date'" and if you save no: "We registered that you
   did not consent on 'date'". Inscpect each time the html code and
   notice that there is a role='status' in the message tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 21 Owen Leonard 2025-07-02 12:40:49 UTC
Created attachment 183693 [details] [review]
Bug 40283: Article request page.

Test plan:

1- Enable the system preference: ArticleRequests.
2- Go to Circulation and Rules in the staff interface (in the
   Administration page, click on Circulation and Rules) and set an
   article request limit.
3- Reach your article requests limit, a message should appear. Inspect
   the HTML code and notice that there is a role="alert" in the message
   tag.
4- Go back to Circulation an dRules in the staff interface and choose
   "No" for  "Article requests". Try to male an article request, a
   message should appear. Inspect the html and notice that there si a
   role="alert".

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 22 Owen Leonard 2025-07-02 12:40:52 UTC
Created attachment 183694 [details] [review]
Bug 40283: Your summary page.

This patch add role="status" and role="alert" to the Summary page.
(opac-user)

Test plan:

1- Enable the system preference OpacReportProblem. If you have a
   checkout record, add a note. A message should appear: "Your note
   about ...". Inspect the html code and notice that there is a
   role="status" in the message tag.
2- Create a new patron account with a card expiration date set to
   tomorrow. Go to the OPAC, log in to this patron account? You should
   notice on your summary page a message: "Your library card will expire
   on ...". Inspect the html code and notice that there is a
   role="alert" in the message tag.
3- Go to the staff interface, patron details, and change the card
   expiration date to yesterday. Go back to the OPAC and you should now
   have the message: "Your account has expired as of...".
4- Go to the staff interface, choose your patron, click on more, and
   choose discharge.
5- Go back to the OPAC, log in to this patron account, and a message
   should appear: "Your account is frozen because it has been
   discharged." Inspect the HTML code and notice that there is a
   role='alert' in the message tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 23 Owen Leonard 2025-07-02 12:40:55 UTC
Created attachment 183695 [details] [review]
Bug 40283: Course reserves page.

Test plan:

1- Enable the system preference: UseCourseReserve.
2- Go to the Course Reserves page, click on the name of the course.
   Inspect the html code of the message: "No reserves have been selected
   for this courses", and notice that there is a role="status" in the
   tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 24 Owen Leonard 2025-07-02 12:40:58 UTC
Created attachment 183696 [details] [review]
Bug 40283: memberentry page.

Added Alert and status role to the messages tags.

Test plan:

1- Enable the system preference: OPACPatronDetails
2- Log in to an adult patron account, go to Personal details
3- Without making any changes, click on "submit update request", the
   alert message should be : 'No changes were made', Inspect the HTML
   code, and notice that there is a role='alert' in the message tag.
4- Change your date of birth to today and submit
5- An error message should appear: "The following fields contain invalid
   information ... Patron's  age ... correct and resubmit". Inspect the
   HTML code and notice that there is a role='alert' in the message tag.
6- Add or change an information, and submit the update. A message should
   appear: 'Thank you ... ' Inspect the HTML code, and notice that there
   is a role='status'.
7- Now disable the system preference OPACPatronDetails. The status
   message should be: 'To make changes to your record, please contact
   the library'. Inspect the HTML code, and notice that there is a
   role='status' in the message tag.
8- Now log out, click on create a new account, fill the required fields,
   and fail the captcha? You should see the error message: 'You typed
   the wrong ... Please try again.' Inspect the HTML code, and notice
   that there is a role='alert' in the message tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 25 Owen Leonard 2025-07-02 12:41:00 UTC
Created attachment 183697 [details] [review]
Bug 40283: Privacy page.

Test plan:

1- Enable the system preferences: OPACPrivacy, OPACHoldsHistory.
2- Change your privacy rule to "forever" or "default" and save. A
   message should appear: "Your privacy rules have been updated."
   Inspect the HTML code and notice that there is a role="status" in the
   message tag.
3- Change your privacy rule to "Never." A message should appear: "This
   option will delete all previous checkout history immediately."
   Inspect the HTML code and notice that there is a role="alert" in the
   message tag.
4- Check if you have a checkout in your checkout history. If you don't,
   make a checkout.
5- Click on "Delete checkout history." If you have a checkout history,
   the message is: "Your checkout history has been deleted." Inspect the
   HTML code and notice that there is a role="status" in the message
   tag.
6- Click again on the "Delete checkout history" button; the error
   message should appear:"No hold history to delete." Inspect the HTML
   code and notice that there is a role="alert" in the message tag.
7- Check if you have a hold in your holds history. If you don't, place a
   hold on a record.
8- Repeat step 5 with the "Delete hold history" button. A message should
   appear: "Your holds history has been deleted." Inspect the HTML code
   and notice that there is a role="status" in the message tag.
9- Repeat step 6 with the "Delete hold history" button.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 26 Owen Leonard 2025-07-02 12:41:03 UTC
Created attachment 183698 [details] [review]
Bug 40283: Change password page (opac-passwd)

Test plan:

1. Enable the system preference: OpacPasswordChange,
   RequireStrongPassword
2. Log in to a Patron account, choose "Change Password". A message
   should appear "You password must contain ... and numbers.". Inspect
   the html code and notice that there is a role="alert" in the message
   tag.
3. Enter an incorrect current password and a new password, then submit.
   A message should appear "Your current password was ... to reset your
   password for you". Inspect the html code, and notice that there is a
   role="alert" in the message tag.
4. Enter your current password, change it to a new one, and confirm. A
   message should appear "Your password has been changed.". Inspect the
   html code, and notice that there is a role="status" in the message
   tag.
5. Go to the Staff interface. Don't allow the system preference:
   OpacPasswordChange. Go back to the OPAC, refresh the page:
   opac-passwd.pl A message should appear "You can't change your
   password". Inspect the html code and notice that there is a
   role='alert' in the message tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 27 Owen Leonard 2025-07-02 12:41:06 UTC
Created attachment 183699 [details] [review]
Bug 40283: Report Problem page.

Test plan:

1. Allow the system preference: OPACReportProblem, and entry an email
   in ReplytoDefault
2. Log in to a patron account.
3. Try to send a problem to a librarian. A message of confirmation
   should appear: "Your problem report has been sent to the library".
   Inspect the html code and notice that there is a role="status" in the
   message tag.
4. Remake step 3 but with a Koha administrator.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 28 Owen Leonard 2025-07-02 12:41:09 UTC
Created attachment 183700 [details] [review]
Bug 40283: Lists page.

Test plan:

1- Enable the system preference: virtualshelves
2- Create a "New list", two messages should appear "List created" and
   "This list is empty... ", inspect the html code of "This list is
   empty ... " and notice that there is a role="status"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 29 Owen Leonard 2025-07-02 12:41:11 UTC
Created attachment 183701 [details] [review]
Bug 40283: Share List page.

Test plan:

1- Enable the system preference: OpacAllowSharingPrivateLists.
2- Try to share the private list and enter an incorrect email format, a
   message should appear: "Sorry, but you did not enter a valid email
   adress."

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 30 Aleisha Amohia 2025-07-02 23:01:05 UTC
Hi Nina, thanks for this patchset!

A question about the role parameter - should it be added to **every** message that might display for the user?

For example, when I was reviewing the changes to the discharge page, I noticed a few <p> messages that have not been given a role:

+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt
@@ -37,7 +37,7 @@
                     [% END %]
 
                     [% IF success %]
-                        <p>Your discharge request has been sent. Your discharge will be available on this page within a few days.</p>
+                        <p role="status">Your discharge request has been sent. Your discharge will be available on this page within a few days.</p>
                     [% ELSIF available %]
                         <p><a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a></p>
                     [% ELSIF pending %]
@@ -59,7 +59,7 @@
                             [% IF failure %]
                                 <p> There was an error during the discharge process </p>
                             [% END %]


Specifically the "Get your discharge" link and "There was an error during the discharge process" failure message. Should these kinds of messages have roles too?