Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-8534

HTL data-sly-set: strange evaluation behavior

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Scripting HTL Runtime 1.1.0-1.4.0
    • Fix Version/s: None
    • Component/s: Extensions
    • Labels:
      None

      Description

      Hello,

      Here is an example to illustrate the issue:

      <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>
      

      while:

      <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>
      

      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!

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ahmedmusallam Ahmed Musallam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: