Editing the alternative text for the SVG does not produce the intended effect

Created on 12 October 2023, about 1 year ago
Updated 13 October 2023, about 1 year ago

Problem/Motivation

While utilizing the SVG_image_field module version 2.2 on Drupal version 9.5.10, the addition of alternative text (alt text) for SVG files functions properly. The specified text is correctly displayed in the HTML. However, an issue arises when attempting to edit the alt text through the media library. Despite modifications, the HTML representation remains unchanged, displaying the original value.

Upon inspecting the database, it was observed that the existing alt value originates from the media_field_revision table, representing the initial upload of the SVG, while the new value is stored in the database correctly in other table.

Also, Create new revision isn't checked for SVG media type.

Steps to reproduce

1- Add a new SVG media with alt text for any content type using Layout builder
2- The alt text is observed with no issues
3- Edit the uploaded SVG's alt text from media library
4- Alt value is changed in backend, while in frontend still the original one which came from revision data at first time SVG is uploaded

🐛 Bug report
Status

Postponed: needs info

Version

2.2

Component

Code

Created by

🇯🇴Jordan suhaib_hija

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @suhaib_hija
  • 🇨🇦Canada optasy

    I wasn't able to replicate this, how do I add the new field?

  • Status changed to Postponed: needs info about 1 year ago
  • 🇪🇨Ecuador jwilson3

    I was also unable to replicate this issue on the latest versions via https://simplytest.me using Drupal core 10.1.5 and SVG Image Field 2.3.

    My main question though is how exactly is Layout Builder relevant to adding an SVG media to a node? Please elaborate on this step to clarify the setup, because the problem you're seeing could be related to field block caching or any number of things related to LB.

    Assumptions I made while testing:

    • Launch https://simplytest.me with Drupal core and SVG Image Field module.
    • Enable Layout Builder module and configured the Default view mode of the "Article" content type to use Layout Builder. I left the option "Allow each content item to have its layout customized" unchecked.
    • Enable "Media", "Media Library" and the "SVG Image Field - Media bundle" submodule, in order to have the "Vector image" media type.
    • Add a "Media" field to the "Article" content type and allow selection from the "Vector Image" media type in field config settings.
    • Edit the "Article" Layout and add the "Media" content block. Configure it to display the "Rendered entity" using the "Default" view mode.
    • Create a node, uploading an SVG to the media library and specifying the Alt text and clicked "Save"
    • Verify the alt text on the IMG tag from the full node display.
    • Click the contextual link to edit the Media item and change the Alt text.
    • Return to the full node display and verify that the ALT text has been updated.

    For now I'm marking this one as "Postponed (maintainer needs more info)", but feel free to change the status back to "Active" when you've provided repeatable steps that I can follow on a clean install using https://simplytest.me

    Thanks.

Production build 0.71.5 2024