Problem/Motivation

This is great module. I used this module for brand kit table. Our table shows download now link multiple times for different files. As per ADA, we need to add aria-label to provide more detail to screen readers.

Steps to reproduce

Proposed resolution

Added configuration for aria-label in field formatter settings with token support. So we can configure the parent field values as aria-label.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

iyyappan.govind created an issue. See original summary.

iyyappan.govind’s picture

StatusFileSize
new5.86 KB

Here is the patch. Please review my patch.

iyyappan.govind’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3318657-02.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

danflanagan8’s picture

Thank you very much for this issue, @iyyappan.govind!

I have always suspected there was more a11y stuff that could be done here, but I am far from an expert in that realm.

I have a question about aria-label. Would it be typical for the aria-label to be identical to any of the other fields we already have? For example, is the aria-label usually the same as the title? Or is the aria-label usually the same as the visible label?

iyyappan.govind’s picture

StatusFileSize
new70.63 KB

Hi @danflanagan8

Yes ARIA labels should explain actual context of the file to screen reader. If we have a 4 Download link in same page then it will not have more information to screen readers. So it is difficult for user to understand the what that Download link will do. So ARIA label should not be static. I used Media name or Media Description field as token in ARIA label in formatter configuration after I added the above patch which is more informative. I hope this helps. Thanks!!

ChrisSnyder made their first commit to this issue’s fork.

chrissnyder’s picture

Status: Needs work » Needs review
StatusFileSize
new9.05 KB

Thank you for your work on this @iyyappan.govind!

I've opened a MR with the changes from the above patch and made a few changes to ensure that tests still pass and this functionally will still work if the token module is not installed.

Attached is a patch mirroring the MR for patching your own project.

chrissnyder’s picture

StatusFileSize
new9.05 KB

Update patch file with the recent fix to aria label HTML attribute.

chrissnyder’s picture

Note: Currently, the patch will not apply to the current stable 2.0.3 version of this module. In order to apply this patch to your site/project, you will need to include additional commits/patches that are currently only on the dev branch.

If using composer-patches, update your composer.json with the following in the "patches" config:

            "drupal/file_download_link" : {
                "3268442 - File Download Link functional js tests failing": "https://git.drupalcode.org/project/file_download_link/-/commit/f144895000bc5543db3e953854debb8faf5a4f05.patch",
                "3333961 - Enhance file_download_link XSS test": "https://git.drupalcode.org/project/file_download_link/-/commit/d0827350d0a36fd0ac1deff78182da8b2b9c356d.patch",
                "3349706 - Refactor file_download_link Kernel tests": "https://git.drupalcode.org/project/file_download_link/-/commit/c67506244dd6bfb9b02fddbed85bfc2854ceaeb8.patch",
                "3318657 - Support ARIA label": "https://www.drupal.org/files/issues/2023-10-02/file_download_link-support_aria_label-3318657-10.patch"
            }

astonvictor made their first commit to this issue’s fork.

astonvictor’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.