Skip to content
Snippets Groups Projects
Commit cd4276f5 authored by Prasad's avatar Prasad
Browse files

Merge branch 'Report_recordModel_api_support' into 'master'

Fixes: #1114 :: Uma:: explode api is replaced with preg_split in Reports model

See merge request !427
parents a50766f6 e2f0177d
No related branches found
No related tags found
No related merge requests found
......@@ -770,9 +770,9 @@ class Reports_Record_Model extends Vtiger_Record_Model {
* @return <String> $query (by removing all columns)
*/
function generateCountQuery($query){
$from = explode(' from ' , $query, 2);
$from = preg_split("/ from /i", $query, 2);
//If we select the same field in select and grouping/soring then it will include order by and query failure will happen
$fromAndWhereQuery = explode(' order by ', $from[1]);
$fromAndWhereQuery = preg_split('/ order by /i', $from[1]);
$sql = "SELECT count(*) AS count FROM ".$fromAndWhereQuery[0];
return $sql;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment