-
Bug
-
Resolution: Fixed
-
Neutral
-
2.7.1
-
None
-
Empty show more show less
-
AuthX 17
-
1
Steps to reproduce
- Â Create a page that contains a link to another page
- Â Call getContentByCategoryIdentifier(String, String) in CategorizationTemplatingFunctions to get all the content that is related to category whose uuid is the uuid of the page linked in previous step, i.e. what is passed as parameter is not the UUID of a category but another UUID (of a page). You can make use of the following script:
catfn = info.magnolia.objectfactory.Components.getComponent(info.magnolia.module.categorization.functions.CategorizationTemplatingFunctions.class) println(catfn.getContentByCategoryIdentifier("PATH", "UUID"))
Expected results
Since passed UUID is not a category, no results are returned
Actual results
Page with link is returned
Workaround
Create an alternative function just like the existing one but using JCR-SQL2 instead of the deprecated XPATH expression
Development notes
According to the query that is generated, it should look for UUIDs within categories property:
...[jcr:contains(.categories, ''{1}'')]"
This is the only function making use of XPATH query, which is deprecated. Translating the existing query to the following would work as expected:
select * from [mgnl:content] as t WHERE CONTAINS(t.categories,'UUID') AND ISDESCENDANTNODE('PATH')
Acceptance criteria