Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error during import #15

Open
tiloschroeder opened this issue Aug 4, 2021 · 1 comment
Open

Fatal error during import #15

tiloschroeder opened this issue Aug 4, 2021 · 1 comment

Comments

@tiloschroeder
Copy link

tiloschroeder commented Aug 4, 2021

Symphony: 2.7.10
PHP: 7.3.28

When I select a file to import and then click on "Next step", the following error message appears:

03.08.2021 15:16 > Warning: GenericErrorHandler 2: count(): Parameter must be an array or an object that implements Countable on line 158 of file /home/webptifvz/html/example.org/extensions/importcsv/lib/parsecsv-0.3.2/parsecsv.lib.php
03.08.2021 15:16 > Fatal Error: ErrorException 0 - count(): Parameter must be an array or an object that implements Countable on line 158 of /home/webptifvz/html/example.org/extensions/importcsv/lib/parsecsv-0.3.2/parsecsv.lib.php

The error can be solved by commenting out the line in the file parsecsv.lib.php.

@animaux
Copy link

animaux commented Aug 8, 2021

@tiloschroeder errors with count() turned up in quite a few extensions. We could try and update parsecsv from 0.3.2 to current version 1.3.1, but I wonder if that might lead to other problems with the extension. The function seems to be totally different in the current version.

A quick fix for PHP 7.3+ to this line is:

	if ( count((is_countable($conditions)?$conditions:[])) > 0 ) $this->conditions = $conditions;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants