Dashboard dashlets are giving empty results after applying the filters in my open cases dashlet

Hello All,

I was trying to filter the dashlets and getting empty results.

Dashboard dashlets are giving empty results after applying the filters in my open cases dashlet

Please help me out from this issue

Thanks in advance

We can’t help you without some basic information such as version numbers

Hello @pgr

My suitecrm configurations details are as follows
SuiteCRM-Version : 7.13.2
PHP version : 7.4
MySQL : 5.7.40
Server : nginx
OS: Ubuntu
ISSUE:
This Dashlets issue has been resolved by debugging the PHP code in DashletGeneric.php file inside /include/Dashlets/DashletGeneric.php

My issue is dashlets are giving empty results when we apply the filters, The below screenshot
is suitecrm.log file generated lines when we apply the filters for a specific dashlets.

I found that the SQL query is generating empty string inside SQL - IN parameters.
Resolution
I decided to search those lines in WhereArray variable and added below lines of code inside DashletGeneric.php file
after the line number 473 inside the if (!empty($whereArray)) { condition.

$search_string = "IN ('')"; 
foreach($whereArray as $value){
    $result = strpos($value, $search_string);
    if($result !== false){
        $matched_value = $value;
    }
    if($matched_value !== ''){
        $pos = array_search($matched_value, $whereArray);
        if ($pos !== false) {
            unset($whereArray[$pos]);
        }
    }
}

Which resolves my issue and returned the results as expected.

Warm Regards
Vajragiri Vishwa

Nice work.

Does the same issue also happen in the latest SuiteCRM version? Maybe you can contribute your fix on Github…

Hello @pgr

Latest Version may not have this issue because as suitecrm 8 running symfony framework. it may get handled over there.
By the way thanks for your suggestion will start posting my fixes in GITHub.

Warm Regards
Vajragiri Vishwanath

1 Like