Bug #82227
closed
Epic #82226: PHP 7.2
count(): Parameter must be an array or an object that implements Countable
Added by Alexander Opitz about 7 years ago.
Updated over 6 years ago.
Description
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/opitz/projects/typo3-master/typo3_src-git/vendor/typo3fluid/fluid/src/ViewHelpers/CountViewHelper.php line 67
Faced the same with typo3 8.7 and php v7.1
You can see the source of the ViewHelper here: https://github.com/TYPO3/Fluid/blob/master/src/ViewHelpers/CountViewHelper.php
- The exception is quite intentional and the case you have should have caused PHP warnings before the exception was introduced
- The VH is aware of NULL and returns 0 for that case
- Which leads me to believe the data you passed here may in fact neither be an array nor countable in which case the error is to be expected?
@Claus
As you didn't responded to me on Slack.
This issue is fixed for master (As you can see I added the pull request), but we need a backport for the TYPO3 8 LTS.
Also I like that https://github.com/TYPO3/Fluid/pull/283 gets somehow backported so we can use it in TYPO3 8 LTS.
TYPO3 8 LTS was released with fluid 2.3.1 and we should try to stay in a line for every LTS. I see that there was a 2.3.4 release, but this do not include the PHP 7.2 fix (nor the one above).
So how we can resolve this here?
ATM the discussion is on the point, that we will do a 2.3.5 release in a 2.3 branch, which includes the needed fixes from this issue ... as also fixes for other issues.
For background information: What it would mean to update to 2.4:
TYPO3 8.7 marked is compatible with fluid ^2.3
https://github.com/TYPO3/TYPO3.CMS/blob/f368dedac509b4d8284fc0353cda668ab3053df2/composer.json#L52
Users installing TYPO3 with composer will get fluid 2.4. If this is a problem we should take action soon (and maybe rethink the fluid release strategy)
ATM the discussion is on the point, that we will do a 2.3.5 release in a 2.3 branch
If TYPO3 8.7 is compatible with fluid 2.4, then branching fluid isn't necessary.
If TYPO3 8.7 isn't compatible, we need to change the composer requirement and disallow fluid 2.4, which would be breaking somehow.
- Target version set to 8.7.10
- Related to Task #83774: Update typo3fluid/fluid to 2.4.0 added
- Status changed from New to Under Review
- Status changed from Under Review to Closed
Also available in: Atom
PDF