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)

Reply via email to