See core issue #2362643:

Example inside an svg that is imported in css as data-url:
<path fill="url(#SVGID_1_)" d="M1256.4,386h1500v21h-1500V386z"/>

Notice the "url(#SVGID_1_)". This will be converted to
url(http://domain.com/path/path/#SVGID_1_1)

Resulting in a broke svg.

The previously mentioned issue has been moved around between Advagg and Core about five times and is now resting in Core. There's a patch available which fixes the issue there, but it's not yet fixed in Advagg. If Core has been patched, Advagg's CssOptimizer::updateUrls() and CssMinifier::loadNestedFile() methods will still break SVGs.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mbrc created an issue. See original summary.

mbrc’s picture

Status: Active » Needs review
FileSize
1.94 KB

Here's a patch which fixes the issue. It has been adapted from the latest Core patch in #2362643.

  • NickWilde committed a7ce16f on 8.x-3.x authored by mbrc
    Issue #2905040 by mbrc: Drupal alters SVG fill paths with base URL →...

NickDickinsonWilde’s picture

Status: Needs review » Fixed

Thanks for the patch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

W01F’s picture

Related to https://www.drupal.org/project/advagg/issues/3087226, but this patch no longer applies to ^4.0