Bug #82227
closedEpic #82226: PHP 7.2
count(): Parameter must be an array or an object that implements Countable
0%
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
Updated by Alexander Opitz about 7 years ago
Updated by Faton Haliti about 7 years ago
Faced the same with typo3 8.7 and php v7.1
Updated by Claus Due about 7 years ago
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?
Updated by Alexander Opitz almost 7 years ago
@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?
Updated by Susanne Moog almost 7 years ago
For background information: What it would mean to update to 2.4:
https://github.com/TYPO3/Fluid/compare/2.3.4...2.4.0
Updated by Alexander Opitz almost 7 years ago
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.
Updated by Alexander Opitz almost 7 years ago
State: The fluid 2.3 branch was created and pull request with latest fixes was created: https://github.com/TYPO3/Fluid/pull/364
Updated by Helmut Hummel almost 7 years ago
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.
Updated by Andreas Kienast almost 7 years ago
- Related to Task #83774: Update typo3fluid/fluid to 2.4.0 added
Updated by Gerrit Code Review almost 7 years ago
- Status changed from New to Under Review
Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55555
Updated by Gerrit Code Review almost 7 years ago
Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55555
Updated by Gerrit Code Review almost 7 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55560
Updated by Gerrit Code Review almost 7 years ago
Patch set 4 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55555
Updated by Christian Kuhn almost 7 years ago
- Status changed from Under Review to Closed
resolved by #83774