You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Ahmed Musallam (JIRA)" <ji...@apache.org> on 2019/06/25 16:57:00 UTC

[jira] [Created] (SLING-8534) HTL data-sly-set: strange evaluation behavior

Ahmed Musallam created SLING-8534:
-------------------------------------

             Summary: HTL data-sly-set: strange evaluation behavior
                 Key: SLING-8534
                 URL: https://issues.apache.org/jira/browse/SLING-8534
             Project: Sling
          Issue Type: Bug
          Components: Extensions
    Affects Versions: Scripting HTL Runtime 1.1.0-1.4.0
            Reporter: Ahmed Musallam


Hello,

Here is an example to illustrate the issue:


{code:java}
<div
    data-sly-set.a="${null}"
    data-sly-set.b="${null}"
    data-sly-set.isEmpty="${!a || !b}">
    ${isEmpty} <!-- renders: true -->
</div>
<div
    data-sly-set.a="${a || 'AAAA'}"
    data-sly-set.b="${b || 'BBBB'}">
    ${isEmpty} <!-- renders: true -->
</div>
{code}

while:


{code:java}
<div
    data-sly-set.a="${null}"
    data-sly-set.b="${null}"
    data-sly-set.isEmpty="${!a || !containerPath}"
    data-sly-set.a="${a || 'AAAA'}"
    data-sly-set.b="${b || 'BBBB'}">
    ${isEmpty} <!-- renders: false -->
</div>
{code}

It appears to me that HTL evaluates data-sly-set expressions in alpha-order on the same element? 
or maybe it finds duplicates and only evaluates the last one in each duplicate set?

Either way, I believe it should evaluate all attributes in order they are written. Any insight into this would be very helpful!

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)