[
https://issues.apache.org/jira/browse/SLING-8896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Radu Cotescu updated SLING-8896:
--------------------------------
Description:
The following HTL construct will result in an error when trying to initialise
the passed use object:
{code:html}
<div data-sly-use.pojo="${'org.example.Pojo' @ path='/a/b/c'}"></div>
{code}
What will happen currently is that the {{path}} option will be interpreted as a
URI manipulation indicator, with the construct being equivalent to:
{code:html}
<div data-sly-use.pojo="/a/b/c/org.example.Pojo"></div>
{code}
The bug is caused by the fact that the
{{org.apache.sling.scripting.sightly.impl.filter.URIManipulationFilter}} acts
on all contexts, except for {{data-sly-template}} and {{data-sly-call}}.
However, the filter should exclude {{data-sly-template}}, {{data-sly-call}},
{{data-sly-use}}, {{data-sly-resource}} (handled in a runtime extension) and
{{data-sly-include}} (also handled in a runtime extension).
was:
The following HTL construct will result in an error when trying to initialise
the passed use object:
{code:html}
<div data-sly-use.pojo="${'org.example.Pojo' @ path='/a/b/c'}"></div>
{code}
What will happen currently is that the {{path}} option will be interpreted as a
URI manipulation indicator, with the construct being interpreted as:
{code:html}
<div data-sly-use.pojo="/a/b/c/org.example.Pojo"></div>
{code}
The bug is caused by the fact that the
{{org.apache.sling.scripting.sightly.impl.filter.URIManipulationFilter}} acts
on all contexts, except for {{data-sly-template}} and {{data-sly-call}}.
However, the filter should exclude {{data-sly-template}}, {{data-sly-call}},
{{data-sly-use}}, {{data-sly-resource}} (handled in a runtime extension) and
{{data-sly-include}} (also handled in a runtime extension).
> The URI Manipulation Filter should not interfere with data-sly-use parameters
> -----------------------------------------------------------------------------
>
> Key: SLING-8896
> URL: https://issues.apache.org/jira/browse/SLING-8896
> Project: Sling
> Issue Type: Bug
> Components: Scripting
> Affects Versions: Scripting HTL Compiler 1.2.0-1.4.0
> Reporter: Radu Cotescu
> Priority: Major
> Fix For: Scripting HTL Compiler 1.2.4-1.4.0
>
>
> The following HTL construct will result in an error when trying to initialise
> the passed use object:
> {code:html}
> <div data-sly-use.pojo="${'org.example.Pojo' @ path='/a/b/c'}"></div>
> {code}
> What will happen currently is that the {{path}} option will be interpreted as
> a URI manipulation indicator, with the construct being equivalent to:
> {code:html}
> <div data-sly-use.pojo="/a/b/c/org.example.Pojo"></div>
> {code}
> The bug is caused by the fact that the
> {{org.apache.sling.scripting.sightly.impl.filter.URIManipulationFilter}} acts
> on all contexts, except for {{data-sly-template}} and {{data-sly-call}}.
> However, the filter should exclude {{data-sly-template}}, {{data-sly-call}},
> {{data-sly-use}}, {{data-sly-resource}} (handled in a runtime extension) and
> {{data-sly-include}} (also handled in a runtime extension).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)