Syntax error in getListViewData function of ListViewData in include/ListView/ListViewData.php #5035

Open
opened 2026-02-20 16:28:24 -05:00 by deekerman · 2 comments
Owner

Originally created by @zakriarehan347 on GitHub (Jul 5, 2023).

We face this issue in a number of places in the system where we have used the PHP count function

We face this issue only with PHP 8.0+, because php 8 enforce type check on function parameters.

Code having issue:

(count($_REQUEST["type_basic"] > 1) || $_REQUEST["type_basic"][0] != "")

Possible Solution:

((is_countable($_REQUEST["type_basic"]) && count($_REQUEST["type_basic"]) > 1) || $_REQUEST["type_basic"][0] != "")

We have other instances of the this issue in the system.

  • SuiteCRM Version used: 7.12
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome
  • Environment name and version (e.g. MySQL, PHP 7): PHP 8.18
  • Operating System and version (e.g Ubuntu 16.04): Mac OS
Originally created by @zakriarehan347 on GitHub (Jul 5, 2023). We face this issue in a number of places in the system where we have used the PHP count function We face this issue only with PHP 8.0+, because php 8 enforce type check on function parameters. ### Code having issue: `(count($_REQUEST["type_basic"] > 1) || $_REQUEST["type_basic"][0] != "")` ### Possible Solution: `((is_countable($_REQUEST["type_basic"]) && count($_REQUEST["type_basic"]) > 1) || $_REQUEST["type_basic"][0] != "")` We have other instances of the this issue in the system. * SuiteCRM Version used: 7.12 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome * Environment name and version (e.g. MySQL, PHP 7): PHP 8.18 * Operating System and version (e.g Ubuntu 16.04): Mac OS
Author
Owner

@pgorod commented on GitHub (Jul 5, 2023):

It would be useful to have a more specific list of places where this occurs.

The solution might be different, depending on the logic of each block of code.

@pgorod commented on GitHub (Jul 5, 2023): It would be useful to have a more specific list of places where this occurs. The solution might be different, depending on the logic of each block of code.
Author
Owner

@zakriarehan347 commented on GitHub (Jul 5, 2023):

@pgorod

I checked that we had these sort of issues in other places like ListViewDisplay in older versions, but now I could not find it at any other place in 7.12.

But it need to be resolved for ListViewData.

@zakriarehan347 commented on GitHub (Jul 5, 2023): @pgorod I checked that we had these sort of issues in other places like ListViewDisplay in older versions, but now I could not find it at any other place in 7.12. But it need to be resolved for ListViewData.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5035
No description provided.