Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1104

Resource resolver sets resolution path and resolution path info wrong when resolving resources with sling:alias

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • JCR Resource 2.0.4
    • JCR Resource 2.0.6
    • JCR
    • None

    Description

      If resources use the sling:alias property to alias its name, the resource resolver sets the resolution path and resolution path info resource metadata wrong:

      • resolution path is not the part of the path leading to the resolution but the path of the actual resource
      • resolution path info is wrong if more than one alias is along the resource path (and the alias names do not have the same length)

      For example:

      ..../child
      +- sling:alias = kind // shorter than node name
      +- grandchild
      +- sling:alias = enkel // shorter than node name

      Now resolving ".../kind.html" to a resource sets the meta data as follows:

      resolution path = ".../child" – expected ".../kind"
      resolution path info = ".html" – correct

      Resolving ".../kind/enkel.html" to a resource breaks things up completely:

      resolution path = ".../child/grandchild" – expected ".../kind/enkel"
      resolution path info = "html" – expected ".html"

      The bug is in the path calculation of the JcrResourceResolver2.resolveInternal(String) method where aliases are handled.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            fmeschbe Felix Meschberger
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment