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

ResourceUtil.getParent(Resource) must not use ResourceResolver.resolve

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • JCR API 2.0.2
    • API 2.0.4
    • API
    • None

    Description

      The ResourceUtil.getParent(Resource) method uses the ResourceResolver.resolve method to get the parent resource of the given resource. This is incorrect, since the resolve method applies mapping methods, which are not appropriate here. Here we just want to get resource, therefore the getResource method is to be used.

      Using resolve here may create an endless loop in the JcrResourceResolver2.map(HttpServletRequest, String) method, which uses this method to walk up the parent resource chain - which may result in repated sling:alias resolution.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: