From b8200af85deadfb098231f8e48000fa24a430931 Mon Sep 17 00:00:00 2001 From: Alexander Blanchard Date: Thu, 1 May 2025 23:11:37 +0000 Subject: [PATCH] Bug 39502: Web Usability: Decorative Images Do Not Need ALT Text A accessibility audit has highlighted that some of the decorative images on the opac have alt text which is often followed by a spen that also contains the same text. This results in screen readers reading this information twice. The suggested solution is to set the alt text to null in these instances. Test Plan: Prior to applying patch: 1) Navigate to Koha OPAC 2) Carry out a search 3) On one of the records right click on the Material Type: under the heading 4) Select Inspect 5) Note that the image has an alt text that matches the span that follows 6) Click on the item title and repeat the process for the icon below the contributors. 7) Scroll down to the holdings table and repeat the process for the image in the Item Type column 8) Apply the patch 9) Repeat the steps above and notice that the alt is now null in order to ignored by screen readers 11) Note that for the Dev tools may show alt but if you right click on the page and select View Page Source you will see that the code is alt="" as expected by screen readers 12) Note that for alt tags that have been updated in the xsl files e.g. the small icons that follow 'Material Type: ' may be cached. --- .../tables/items/catalogue_detail.inc | 2 +- .../prog/en/modules/catalogue/advsearch.tt | 2 +- .../prog/en/modules/catalogue/results.tt | 2 +- .../prog/en/modules/virtualshelves/shelves.tt | 2 +- .../en/xslt/MARC21slim2intranetResults.xsl | 22 ++++++------- .../bootstrap/en/modules/opac-advsearch.tt | 2 +- .../bootstrap/en/modules/opac-detail.tt | 2 +- .../bootstrap/en/modules/opac-shelves.tt | 2 +- .../en/xslt/MARC21slim2OPACDetail.xsl | 2 +- .../en/xslt/MARC21slim2OPACResults.xsl | 32 +++++++++---------- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 63a2b319e5..727a59c42e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -388,7 +388,7 @@ [% UNLESS noItemTypeImages %] let image_location = item_type_image_locations[row.item_type_id]; node += image_location - ? '%s '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) + ? ' '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) : ''; [% END %] node += '%s'.format(escape_str(item_type_description)); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt index 5e71518f4b..a5cbfb4ba1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt @@ -208,7 +208,7 @@