- Issue created by @marco.aresu
- ๐บ๐ธUnited States aaronpinero
This seems like a pretty basic and important accessibility problem. I just noticed it today when doing a WAVE report on my website. This issue was the first error reported. I thought it was a content author mistake. It's a surprising oversight for the Media system. Can we bump this up to critical?
- ๐บ๐ธUnited States aaronpinero
I tested the patch with Drupal 9.5.8 and it appears to solve the issue. I am seeing alt attribute information on a media image thumbnail where previously there was none.
- Status changed to Needs work
over 1 year ago 7:55pm 10 May 2023 - last update
over 1 year ago Patch Failed to Apply - ๐บ๐ธUnited States aaronpinero
One thing I noted about the site after the patch: if the image is missing alt text, an empty alt attribute is added to the image. Not sure if that's a desired outcome... would it be better to leave off the alt attribute entirely if there's no text available?
- ๐บ๐ธUnited States aaronpinero
I am uploading a new patch because the current one doesn't apply cleanly through composer with Drupal 9.5.9. There was an update in 9.5.9 to the media thumbnail formatter that need to be accounted for. That said, the patch is VERY similar.
- ๐บ๐ธUnited States froboy Chicago, IL
if the image is missing alt text, an empty alt attribute is added to the image. Not sure if that's a desired outcome...
@aaronpinero as per the Web Accessibility Initiative guidelines:
Decorative images donโt add information to the content of a page. For example, the information provided by the image might already be given using adjacent text, or the image might be included to make the website more visually attractive.
In these cases, a null (empty) alt text should be provided (alt="") so that they can be ignored by assistive technologies, such as screen readers.
I think it's the correct behavior to add an empty alt if none exists so that the images at least behave unobtrusively.
- ๐บ๐ธUnited States froboy Chicago, IL
I'm seeing this issue in 10. Bumping the version.
- last update
over 1 year ago Custom Commands Failed - @froboy opened merge request.
- last update
over 1 year ago 29,444 pass - Status changed to Needs review
over 1 year ago 7:38pm 29 June 2023 - ๐บ๐ธUnited States froboy Chicago, IL
I've opened a MR for Drupal 10.1 and added the diff here for folks to use with composer. I'm not great at tests, but if this needs them and someone could direct me to the right place I can make an attempt at adding them.
- Status changed to RTBC
over 1 year ago 6:37am 30 June 2023 - last update
over 1 year ago Custom Commands Failed - ๐บ๐ฆUkraine podarok Ukraine
Looks good
Here is a diff, no need to upload patches @froboy
https://git.drupalcode.org/project/drupal/-/merge_requests/4291.diff
- ๐บ๐ธUnited States froboy Chicago, IL
@podarok I'm aware, but I didn't want to introduce potential security risks โ . :)
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - Status changed to Postponed: needs info
over 1 year ago 1:10pm 29 July 2023 - ๐ซ๐ฎFinland lauriii Finland
What are the specific steps needed to reproduce this? I tried to follow the steps from the issue summary and couldn't reproduce this
- ๐บ๐ธUnited States Chris Matthews
Like @lauriii, I also tried to follow the step in the IS to reproduce this but I could not. Might be missing something simple but this issue is postponed until lauriii or another committer can reproduce.
- Status changed to Needs review
about 1 year ago 7:12pm 12 October 2023 - ๐บ๐ธUnited States froboy Chicago, IL
I believe I've been able to reproduce the issue on a clean environment:
Control:
- Spin up a new Umami site (I used https://ddev.github.io/ddev-gitpod-launcher/)
- Observe the alt text of the borscht in the card on the homepage - "Traditional Ukrainian soup with beets, tomatoes, and pork ribs"
- Go to Content > Media > "borscht" and edit the "Borscht with pork ribs" image
- Change the alt text to "Yummy traditional Ukrainian soup with beets, tomatoes, and pork ribs"
- Save the image
- Return to the homepage and observe the alt has properly updated.Failure case:
- Go to Admin > Structure > Content Types > Recipe > Manage Display > Card common alt (/en/admin/structure/types/manage/recipe/display/card_common_alt)
- Change the Media Image Format from "Rendered entity" to "Thumbail" (no other settings matter)
- Save
- Return to the homepage and observe the alt text has reverted to "Traditional Ukrainian soup with beets, tomatoes, and pork ribs"
- (optional) Try clearing caches, because that could be a thing. No change on cache clear.
- Apply patch, clear caches
- Observe alt text properly updates
- Change alt text on media again, observe it properly updates againI hope that helps. Thanks for your time.
- Status changed to Needs work
about 1 year ago 7:31pm 12 October 2023 - ๐บ๐ธUnited States smustgrave
Thanks for providing steps!
This is NW though for the tests and upgrade paths.
- ๐บ๐ธUnited States aaronpinero
Hi all. I would definitely like to move this issue along. It's been indicated that tests are needed to move this back to "needs review". I would like to help but I am a novice developer and the only tests I've ever written for a module were based heavily on provided examples of Unit and Kernel tests. I don't know a whole lot about selecting the appropriate tests and then writing them.
That said, I did a bit of digging into the media module code. For tests related to the thumbnail formatter (where the proposed patch is applied) there is a Kernel test (core/modules/media/tests/src/Kernel/MediaThumbnailFormatterTest.php) and a Functional test (core/modules/media/tests/src/Functional/FieldFormatter/MediaThumbnailFormatterTest.php). The Kernel test seems to provide only a test to verify settings of the field formatter. The Functional test appears to actually test the rendering of the formatted media field as it would be used in a node.
Based on what I'm reading in the code, the appropriate test addition for this change to the module would be to modify the Functional test that already exists to include some check of the rendered alt text vs the alt text stored in the reference media entity. Leaving aside (for the moment) the details of actually executing this change to the functional test, does this seem like a reasonable plan? Are there additional tests that would need to be included that I haven't considered?
- ๐บ๐ธUnited States mikegodin
Here's the patch from #7, adjusted for Drupal 10.1.5
- last update
about 1 year ago 29,674 pass - ๐บ๐ธUnited States neclimdul Houston, TX
This has a long history and a bunch of other issues trying to address is in different ways. This seems to currently be the most active, so linking them up.
- ๐บ๐ธUnited States neclimdul Houston, TX
It looks like the current patch remove the thumbnail entirely if there's an image. I guess that works, but does it really solve the problem? Should we get rid of the thumbnail entirely for all cases? Is there a use case where the thumbnail is still needed but you wouldn't be able to manage the thumbnail title and alt properties?
- ๐บ๐ธUnited States nathan573 New York
I have a View that displays media items of various types. This default generic "media-icon" icons show for each item that isn't an image - like documents or videos in the media library. Applying this patch makes this View render a blank space instead of these generic media icons.
Thanks