Bug #82227

Epic #82226: PHP 7.2

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

Added by Alexander Opitz about 2 years ago. Updated over 1 year ago.

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

0%

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

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

Associated revisions

Revision 79a58ed0 (diff)
Added by Christian Kuhn over 1 year ago

[TASK] Update typo3fluid/fluid to 2.5.0

Fixes various issues, brings PHP 7.2 compatibility
to v8 core branch of standalone fluid.

composer command used:
composer update typo3fluid/fluid

Change-Id: I52c3a97e7dc8dafd7b0dee1e07df5105f29cdbde
Resolves: #83774
Resolves: #82227
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/55560
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>
Reviewed-by: Jan Stockfisch <>
Tested-by: Jan Stockfisch <>
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision a8da8555 (diff)
Added by Christian Kuhn over 1 year ago

[TASK] Update typo3fluid/fluid to 2.5.0

Fixes various issues, brings PHP 7.2 compatibility
to v8 core branch of standalone fluid.

composer command used:
composer update typo3fluid/fluid

Change-Id: I52c3a97e7dc8dafd7b0dee1e07df5105f29cdbde
Resolves: #83774
Resolves: #82227
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/55555
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>
Tested-by: TYPO3com <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Alexander Opitz about 2 years ago

  • PHP Version set to 7.2

#3 Updated by Faton Haliti about 2 years ago

Faced the same with typo3 8.7 and php v7.1

#4 Updated by Claus Due about 2 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?

#5 Updated by Alexander Opitz almost 2 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?

#6 Updated by Susanne Moog almost 2 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

#7 Updated by Alexander Opitz almost 2 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.

#8 Updated by Alexander Opitz over 1 year ago

State: The fluid 2.3 branch was created and pull request with latest fixes was created: https://github.com/TYPO3/Fluid/pull/364

#9 Updated by Helmut Hummel over 1 year 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.

#10 Updated by Susanne Moog over 1 year ago

  • Target version set to 8.7.10

#11 Updated by Andreas Fernandez over 1 year ago

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

#12 Updated by Gerrit Code Review over 1 year 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

#13 Updated by Gerrit Code Review over 1 year 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

#14 Updated by Gerrit Code Review over 1 year 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

#15 Updated by Gerrit Code Review over 1 year 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

#16 Updated by Christian Kuhn over 1 year ago

  • Status changed from Under Review to Closed

resolved by #83774

Also available in: Atom PDF