[BUGFIX] Only count items in ForViewHelper when ``iteration`` argument is set 18/40718/2
authorMathias Brodala <mbrodala@pagemachine.de>
Mon, 29 Jun 2015 07:49:48 +0000 (09:49 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 29 Jun 2015 13:04:22 +0000 (15:04 +0200)
commit3db88fe1151c23f4ccde215b4c463481b98ae358
treea9733ac287f54c931e8330c160081206a1f0c141
parente1198d922938df2d8856d3a5eda84b805864f767
[BUGFIX] Only count items in ForViewHelper when ``iteration`` argument is set

When using the ``iteration`` argument, the ``ForViewHelper`` provides
information about the current iteration, including the ``cycle`` and
``total``. Therefore it needs to count all elements.
The problem is, that this happens even if the iteration argument is
not specified leading to performance issues especially when iterating
over a (subset of a) lot of (remote) items.

This patch fixes this by adding a check for the ``iteration`` argument.

Resolves: #67801
Releases: master, 6.2
Change-Id: I4645ed03322bea36f2c36263378900f401626f24
Reviewed-on: http://review.typo3.org/40718
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/fluid/Classes/ViewHelpers/ForViewHelper.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/ForViewHelperTest.php