Project

General

Profile

Actions

Bug #82227

closed

Epic #82226: PHP 7.2

count(): Parameter must be an array or an object that implements Countable

Added by Alexander Opitz over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Fluid
Target version:
Start date:
2017-08-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #83774: Update typo3fluid/fluid to 2.4.0Closed2018-02-04

Actions
Actions #1

Updated by Alexander Opitz over 6 years ago

  • PHP Version set to 7.2
Actions #3

Updated by Faton Haliti over 6 years ago

Faced the same with typo3 8.7 and php v7.1

Actions #4

Updated by Claus Due over 6 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?
Actions #5

Updated by Alexander Opitz over 6 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?

Actions #6

Updated by Susanne Moog over 6 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

Actions #7

Updated by Alexander Opitz over 6 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.

Actions #8

Updated by Alexander Opitz over 6 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

Actions #9

Updated by Helmut Hummel about 6 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.

Actions #10

Updated by Susanne Moog about 6 years ago

  • Target version set to 8.7.10
Actions #11

Updated by Andreas Kienast about 6 years ago

  • Related to Task #83774: Update typo3fluid/fluid to 2.4.0 added
Actions #12

Updated by Gerrit Code Review about 6 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

Actions #13

Updated by Gerrit Code Review about 6 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

Actions #14

Updated by Gerrit Code Review about 6 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

Actions #15

Updated by Gerrit Code Review about 6 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

Actions #16

Updated by Christian Kuhn about 6 years ago

  • Status changed from Under Review to Closed

resolved by #83774

Actions

Also available in: Atom PDF