salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.44k stars 2.07k forks source link

Fix non-countable error when importing CSV #10285

Open pgorod opened 9 months ago

pgorod commented 9 months ago

Description

Not my issue, see this forum thread for details: https://community.suitecrm.com/t/php-fatal-error-uncaught-typeerror-count-argument-1-value-must-be-of-type-countable-after-upgrade-to-suite-7-14/91224

[Thu Dec 14 19:43:01.002817 2023] [php:error] [pid 35371] [client 127.0.0.1:45634] 
PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in modules/Import/views/ImportListView.php:131

Stack trace:
#0 modules/Import/views/view.last.php(189): ImportListView->display()
#1 modules/Import/views/view.last.php(141): ImportViewLast->getListViewTableFromFile()
#2 include/MVC/View/SugarView.php(210): ImportViewLast->display()
#3 include/MVC/Controller/SugarController.php(432): SugarView->process()
#4 include/MVC/Controller/SugarController.php(363): SugarController->processView()
#5 include/MVC/SugarApplication.php(101): SugarController->execute()
#6 index.php(52): SugarApplication->execute()
#7 {main} thrown in modules/Import/views/ImportListView.php on line 131, referer: index.php

Problem only happens with PHP v8, not with v7.4.

How To Test This

Import CSV?

Types of changes

Final checklist

SuiteBot commented 9 months ago

This pull request has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/php-fatal-error-uncaught-typeerror-count-argument-1-value-must-be-of-type-countable-after-upgrade-to-suite-7-14/91224/9

serhiisamko091184 commented 9 months ago

Hi @pgorod,

Thanks for your PR!

Regards, Serhii