vt711: Bug in Report Record model
If you have a cusom (vtlib) module and you have written your module's generateReportsQuery() method to use UPPERCASE SQL keywords, then the generateCountQuery() method in the Report Record Model is going to fail.
Here: http://code.vtiger.com/vtiger/vtigercrm/blob/master/modules/Reports/models/Record.php#L773
and
here: http://code.vtiger.com/vtiger/vtigercrm/blob/master/modules/Reports/models/Record.php#L775
The php explode function is case sensitive.
Replacing with preg_split gets around this problem, e.g.
$from = preg_split("/ from /i", $query);
and $fromAndWhereQuery = preg_split('/ order by /i', $from[1]);