U4-10821 - Regression of U4-6193: Inserting an image into grid layout ignores alternative text

Created by Rick Mason 10 Jan 2018, 15:43:34 Updated by Robert Copilau 05 Mar 2018, 13:37:04

Tags: PR

Relates to: U4-6193

Subtask of: U4-11011

Your report will have a greater chance of being addressed if you can give us clear steps to reproduce the issue, please answer the following questions in as much detail as possible:

What did you do?

Set up a property using the Umbraco Grid, and allow the image grid editor. Insert an image, specifying alt text.

What did you expect to happen?

The alt text entered becomes the value of the alt="" attribute in the image.

What actually happened?

It is not used. Specify a caption and that is used as the alt text.

This is a partial regression of U4-6193:

line 17 of src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Media.cshtml* ''Before''

<img src="@url" alt="@Model.value.caption">

''After''

<img src="@url" alt="@Model.value.altText">

It seems to have [https://github.com/umbraco/Umbraco-CMS/commit/babcbd2f7aff1a2f522a066c8a5969eed4713088#diff-74012a4b3212268e0653c503824abb23 happened in this commit], which went into Umbraco 7.7.

I would also expect that if alt text is not entered it would render an alt="" attribute, since there are legitimate uses of blank alt text. Without that blank attribute screen readers will read out the image URL which is usually not helpful.

Comments

Matt Wanchap 22 Feb 2018, 02:48:05

Pull request: https://github.com/umbraco/Umbraco-CMS/pull/2460


Robert Copilau 05 Mar 2018, 13:37:01

All good! Thanks @mwanchap :).


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Very Easy

Category: Editor

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.7.6

Due in version:

Sprint: Sprint 80

Story Points: 1

Cycle: 8