Missing alt text attribute when embed image on body field.

Created on 8 August 2019, almost 6 years ago
Updated 19 April 2024, about 1 year ago

We are using: drupal/dropzonejs: 2.0.0-alpha4, drupal/embed: 1.0.0, drupal/entity_browser: 2.2.0, drupal/entity_embed: 1.0.0 to embed a media Image in the body_field. when set the alt (alternative text) on a view “upload image” the alt description is missing:

<drupal-entity data-embed-button="media_entity_embed" data-entity-embed-display="entity_reference:media_thumbnail" data-entity-embed-display-settings="{&quot;image_style&quot;:&quot;&quot;,&quot;image_link&quot;:&quot;&quot;}" data-entity-type="media" data-entity-uuid="3ec0436c-fa11-401a-9792-914de4865b77" data-langcode="en"></drupal-entity>

but if we set the alt description on embed-view it appear on the html tag.

<drupal-entity alt="Test description alt on embed view" data-embed-button="media_entity_embed" data-entity-embed-display="entity_reference:media_thumbnail" data-entity-embed-display-settings="{&quot;image_style&quot;:&quot;&quot;,&quot;image_link&quot;:&quot;&quot;}" data-entity-type="media" data-entity-uuid="d036a679-0f6d-4dde-823c-a12e95078996" data-langcode="en"></drupal-entity>

0n configuration we tried disable the "Limit allowed HTML tags and correct faulty HTML" but didn't work.

If anyone can give some advice, we appreciated.

🐛 Bug report
Status

Needs work

Version

1.0

Component

CKEditor integration

Created by

🇦🇺Australia Mirelyj

Live updates comments and jobs are added and updated live.
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.

  • 🇳🇱Netherlands Eric_A

    Patch #5 does provide the default alt text from the media entity. Thanks!

    However, using language construct empty()is buggy in that it becomes impossible to enter value "0" as an override. (Values "0", NULL and FALSE will result in TRUE when passed to empty().)

    I haven't looked into how core does this with core media. Not familiar with these plugins at all.

Production build 0.71.5 2024