Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-762

$foreach.first and $foreach.last do not have assigned values

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7-beta1
    • Fix Version/s: 1.7, 2.0
    • Component/s: Engine
    • Labels:
      None

      Description

      $foreach.first and $foreach.last are not getting assigned in a loop (while isFirst() and isLast() do) .

      Test case:
      #foreach($i in [1..3])
      index = $foreach.index,
      count = $foreach.count,
      first = $foreach.isFirst() / $foreach.first,
      last = $foreach.isLast() / $foreach.last<br/>
      #end

      Result:
      index = 0, count = 1, first = true / $foreach.first, last = false / $foreach.last
      index = 1, count = 2, first = false / $foreach.first, last = false / $foreach.last
      index = 2, count = 3, first = false / $foreach.first, last = false / $foreach.last

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              serg472 Sergiy Kovalchuk
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: