Skip to content

IconViewHelper does not properly handle SVG FileReference objects, outputs raw SVG code instead of rendering image #1581

@maslme

Description

@maslme

Bug Report

Prerequisites

  • Can you reproduce the problem on TYPO3 v11.5 LTS
  • Can you reproduce the problem on TYPO3 v12.4 LTS
  • Did you perform a cursory search
    to see if your bug or enhancement is already reported?

Description

When using the Text & Icon content element in the Bootstrap Package with an SVG file uploaded via the media field (allowed extensions: gif, png, svg), the frontend output displays the raw SVG XML code as text instead of rendering the SVG image correctly.

In contrast, when using PNG or GIF files in the same field, the icon renders correctly.

Steps to Reproduce

  1. Create a Text & Icon content element in TYPO3 with Bootstrap Package.
  2. Upload and select an SVG file in the icon media field.
  3. Render the page and observe that the SVG source code is printed visibly instead of the SVG image being rendered.
  4. Upload and select a PNG or GIF file in the same field and observe the icon renders correctly.

Expected behavior

SVG files uploaded in the media field should render properly as images in the frontend, similar to PNG or GIF files.

Actual behavior

The frontend output displays the raw SVG XML code as text

Versions

bootstrap_package 15.0.2
typo3 12.4.33

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions