You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Sergiy Kovalchuk (JIRA)" <de...@velocity.apache.org> on 2010/05/18 22:47:43 UTC

[jira] Created: (VELOCITY-762) $foreach.first and $foreach.last do not have assigned values

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

                 Key: VELOCITY-762
                 URL: https://issues.apache.org/jira/browse/VELOCITY-762
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.7-beta1
            Reporter: Sergiy Kovalchuk


$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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-762) $foreach.first and $foreach.last do not have assigned values

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-762.
-----------------------------------

    Fix Version/s: 1.7
                   2.0
       Resolution: Fixed

> $foreach.first and $foreach.last do not have assigned values
> ------------------------------------------------------------
>
>                 Key: VELOCITY-762
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-762
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.7-beta1
>            Reporter: Sergiy Kovalchuk
>             Fix For: 1.7, 2.0
>
>
> $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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-762) $foreach.first and $foreach.last do not have assigned values

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903450#action_12903450 ] 

Nathan Bubna commented on VELOCITY-762:
---------------------------------------

Yes, that too was noticed and fixed.

> $foreach.first and $foreach.last do not have assigned values
> ------------------------------------------------------------
>
>                 Key: VELOCITY-762
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-762
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.7-beta1
>            Reporter: Sergiy Kovalchuk
>             Fix For: 1.7, 2.0
>
>
> $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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-762) $foreach.first and $foreach.last do not have assigned values

Posted by "Michael Osipov (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903288#action_12903288 ] 

Michael Osipov commented on VELOCITY-762:
-----------------------------------------

I'd like to remark that the last last value is incorrect. More over as you can see in my ticket VELOCITY-772 hasNext is always true, which is oncorrect. That's why isLast() fails.

> $foreach.first and $foreach.last do not have assigned values
> ------------------------------------------------------------
>
>                 Key: VELOCITY-762
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-762
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.7-beta1
>            Reporter: Sergiy Kovalchuk
>             Fix For: 1.7, 2.0
>
>
> $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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org