SVG images not displayed

Created on 5 June 2024, 5 months ago
Updated 14 June 2024, 5 months ago

Problem/Motivation

Using SVG image module and core Media, I want to be able to insert SVG Media with CKeditor5 and display them as any other images.

Steps to reproduce

1. Install and setup https://www.drupal.org/project/svg_image_field as described in https://drupal.stackexchange.com/questions/273402/media-module-how-to-en...
2. Create some content and upload an SVG image into CKeditor5
3. Look at the page with Radix theme - the media element is empty
4. Change to another theme - the SVG is shown

<div data-quickedit-field-id="block_content/1/body/de/full" data-component-id="radix:field" class="field field--name-body field--type-text-with-summary field--label-hidden field--item" data-once="quickedit"><!-- THEME DEBUG --><!-- THEME HOOK: 'media' --><!-- FILE NAME SUGGESTIONS:
   * media--source-svg.html.twig
   * media--svg--full.html.twig
   * media--svg.html.twig
   * media--full.html.twig
   x media.html.twig
--><!-- BEGIN OUTPUT from 'themes/custom/lia/templates/content/media.html.twig' --><!-- 🥗 Component start: radix:media --><div class="media media--type- media--unpublished media--view-mode-full" data-component-id="radix:media"></div><!-- 🥗 Component end: radix:media --><!-- END OUTPUT from 'themes/custom/lia/templates/content/media.html.twig' --></div>

Proposed resolution

fix the media component to allow SVG images

Remaining tasks

User interface changes

none

API changes

none

Data model changes

none

🐛 Bug report
Status

Closed: works as designed

Version

6.0

Component

Code

Created by

🇩🇪Germany heliogabal Berlin

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

Comments & Activities

  • Issue created by @heliogabal
  • Hi heliogabal, Thank you for reporting this issue.
    I tried to reproduce the issue based on the steps you provided using the SVG image module and core Media. but, in my testing, the SVG image appears correctly in the media. I'm not sure what might be causing the issue on your end, but it would be helpful if you could retest it or provide more information for more investigation.

  • Status changed to Closed: works as designed 5 months ago
  • 🇩🇪Germany heliogabal Berlin

    Hi Hosisam,

    thanks for checking, I found the problem - I had to add a src-URL to one of the components with the last beta, in order to see images. Now this seems to be fixed, but I had to remove the src again in order to also see SVG.

Production build 0.71.5 2024