Uploaded image for project: '[Read Only] - Addon Channel Manager'
  1. [Read Only] - Addon Channel Manager
  2. CHANNELMGR-2397

Channel Manager breaks with anchors in SVGs

    XMLWordPrintable

Details

    • 0.5
    • Flagged
    • Tiger Sprint 219, Tiger Sprint 220, Tiger Sprint 221

    Description

      If a piece of SVG code that contains an <a> element ( test.svg) is pasted directly in ftl, say base-footer.ftl in an archetype project, the channel manager produces this JS error from app.js:

      TypeError: e.slice is not a function
          at i (app-386e7157bca83b5533c5.js:5)
          at app-386e7157bca83b5533c5.js:6
          at Array.some (<anonymous>)
          at a (app-386e7157bca83b5533c5.js:5)
          at SVGAElement.<anonymous> (app-386e7157bca83b5533c5.js:6)
          at Function.each (vendor-386e7157bca83b5533c5.js:formatted:32985)
          at ge.fn.init.each (vendor-386e7157bca83b5533c5.js:formatted:32895)
          at e.value (app-386e7157bca83b5533c5.js:6)
          at e.value (app-386e7157bca83b5533c5.js:5)
          at app-386e7157bca83b5533c5.js:5

      The front-end's LinkProcessorService doesn't handle <a> elements well, despite this piece of code added in CHANNELMGR-287:

        run(document, internalLinkPrefixes) {
            // handle links within SVG elements
            if (url instanceof SVGAnimatedString) {
              url = url.baseVal;
            }
      

      "instanceof " fails when it shouldn't, url.constructor.name == "SVGAnimatedString" is okay? See

      Happens on 11, on 13 there was a refactor regarding external links already in CHANNELMGR-2188.
      On 12, the error occurs but seems that due to other exception handling it is not shown in the JS console.

      Attachments

        1. CHANNELMGR-2397.png
          226 kB
          Jeroen Hoffman
        2. test.svg
          0.7 kB
          Jeroen Hoffman

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jhoffman Jeroen Hoffman
              Hippo Helpdesk Hippo Helpdesk
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: