Issue Bug Closed

#108690SvgSpriteIconProvider renders complete sprite inline instead of using <use> references

Eric Harrer 01/19/26, 15:36 updated 03/31/26, 08:59

Description

*Description*
Icons registered with SvgSpriteIconProvider are rendered incorrectly in multiple backend contexts. Instead of using <use xlink:href="...#icon-id"> references, the complete sprite file (including all symbols) is rendered inline.

Affected Areas
  • New Content Element Wizard – All plugin icons
  • FormEngine select fields – e.g., tt_content.CType field

Expected Behavior

<svg class="icon-color">
    <use xlink:href="/_assets/.../Sprite.svg#tx-partnerrating"></use>
</svg>

Actual Behavior (New Content Element Wizard only)

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
    <symbol id="tx-partnerrating" viewBox="0 0 64 64">...</symbol>
    <symbol id="tx-partnerrating-department" viewBox="0 0 128 128">...</symbol>
    <!-- All symbols from sprite rendered inline -->
</svg>

Other backend modules (e.g., List Module) correctly use <use> references.

Steps to Reproduce

1. Register icon with sprite:

// Configuration/Icons.php
return [
    'tx-partnerrating' => [
        'provider' => SvgSpriteIconProvider::class,
        'source' => 'EXT:partner_rating/Resources/Public/Icons/Sprite.svg',
        'sprite' => 'EXT:partner_rating/Resources/Public/Icons/Sprite.svg#tx-partnerrating',
    ],
];

2. Create sprite file with multiple symbols
3. Register plugin using the icon:

// Configuration/TCA/Overrides/tt_content.php
ExtensionUtility::registerPlugin(
    'PartnerRating',
    'Pi1',
    'Partner Rating',
    'tx-partnerrating'
);

4. Open New Content Element Wizard
5. Inspect icon in browser DevTools → Complete sprite ( all symbols) rendered inline in Shadow DOM in the new content element wizard and the CType selelct field
6. Compare with List Module → Correctly uses <use xlink:href="...#tx-partnerrating">

Reviews 3

History 311

  1. Benjamin Franzke commented <span data-processor="relativetime" data-value="2026-01-21T12:20:12+00:00" > 01/21/26, 12:20 </span>

    > 'source' => 'EXT:partner_rating/Resources/Public/Icons/Sprite.svg',

    The assumption that the sprite can be supplied as source is wrong. source is meant to point to a standalone SVG file.

    The best we can do is to support inline rendering when no source option is provided.
    I’ve adapted your patch accordingly: https://review.typo3.org/c/Packages/TYPO3.CMS/+/92387/4..5

  2. Eric Harrer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-01-21T15:20:08+00:00" > 01/21/26, 15:20 </span>

    Applied in changeset commit:ae49a1844b9a6e889c30412fa0accaf00ede3e28.