Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-494

DamTemplatingFunctions#getAssetForAbsolutePath throws an IllegalArgumentException when JcrAssetProvider is used and rootPath is set to "/"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.2
    • None
    • None
    • None

      DamTemplatingFunctions#getAssetForAbsolutePath throws an IllegalArgumentException ("relPath is not a relative path:") when info.magnolia.dam.jcr.JcrAssetProvider is used an rootPath is set to "/"

      Problematic code is

      info.magnolia.dam.templating.functions.DamTemplatingFunctions#getAssetForAbsolutePath
      String relativeAssetPath = StringUtils.removeStart(absoluteAssetPath, provider.getRootFolder().getPath() + "/");
      

      Because info.magnolia.dam.jcr.JcrAssetProvider#getPath returns "/" in case when provider root path is set to "/" and then starting "/" is not stripped from absoluteAssetPath.

        Acceptance criteria

              mdivilek Milan Divilek
              mdivilek Milan Divilek
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD