You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (Jira)" <ji...@apache.org> on 2020/08/12 10:06:00 UTC
[jira] [Created] (SLING-9657) Same-name JS Use dependencies are not
always correctly resolved
Radu Cotescu created SLING-9657:
-----------------------------------
Summary: Same-name JS Use dependencies are not always correctly resolved
Key: SLING-9657
URL: https://issues.apache.org/jira/browse/SLING-9657
Project: Sling
Issue Type: Bug
Components: Scripting
Affects Versions: Scripting HTL JS Use Provider 1.2.4
Reporter: Radu Cotescu
Assignee: Radu Cotescu
Fix For: Scripting HTL JS Use Provider 1.2.6
When solving JS dependencies using the resource-type hierarchy, the resolution is not always correct.
Example content structure:
{noformat}
/apps/page/
page.html
head.js
/apps/project/page
[sling:resourceSuperType=page]
page.html
partials/
head.html
head.js
{noformat}
Example calling model:
{{/apps/project/page/page.html}}
{code:html}
<div data-sly-include="partials/head.html}"></div>
{code}
{{/apps/project/page/partials/head.html}}
{code:html}
<div data-sly-use.head="head.js"></div>
{code}
With the above setup, the {{head.js}} script being select is the one from {{/apps/page/head.js}}, instead of the file inside {{partials}}. While this takes the resource type hierarchy into consideration, the correct caller is {{partials/head.html}}, hence why the resolution should happen "locally".
--
This message was sent by Atlassian Jira
(v8.3.4#803005)