The source of alt text in embedded image media is not clear

Created on 26 September 2019, over 5 years ago
Updated 19 May 2025, 15 days ago

Problem/Motivation

When an author embeds image media in the wysiwyg editor, they can choose to:

  1. accept the default text alternative previously stored with the media entity, or
  2. override the alt text with an instance-specific alt text,

If they accept the default alt text (because it is appropriate for the context) this isn't explicitly recorded; i.e. nothing is stored in the editor markup.

BUT if the default alt text stored with the media entity changes at a later date, then the new alt text propagates to the all existing embed instances which haven't overridden it.

The problem is that the original alt text may have been accepted because is was appropriate to the context, but the new alt text might not be. The upshot is that there may be unintended side effects, where content effectively changes it's meaning.

This is almost in the realm of accidental data loss.

Proposed resolution

When authors embed a media image, and accept the default ALT text from the media entity, explicitly store it in the <drupal-media alt="whatever" markup.

Remaining tasks

TBD.

User interface changes

TBD.

API changes

TBD.

Data model changes

None?

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

media system

Created by

πŸ‡¬πŸ‡§United Kingdom andrewmacpherson

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This came up as a daily BSI target.

    Is the issue here that the alt text is not included in the embed code? Is that really a problem though?

Production build 0.71.5 2024