Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
JCR Resource 2.0.4
-
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.