Skip to content
Snippets Groups Projects
Commit d35f659b authored by Uma's avatar Uma
Browse files

Merge branch '1016_Performance_Patch' into 'master'

Fix for performance and invalid crmid retrieval from crmentityrel. Refs #1016

See merge request !688
parents 7a24be65 cc357e00
No related branches found
No related tags found
No related merge requests found
......@@ -1675,7 +1675,8 @@ class Vtiger_Module_Model extends Vtiger_Module {
if($tablename == 'vtiger_crmentityrel'){
$sql .= ' LEFT JOIN vtiger_activity ON vtiger_activity.activityid = vtiger_crmentity.crmid ';
$sql .= " INNER JOIN $tablename ON ($tablename.relcrmid = vtiger_crmentity.crmid OR $tablename.crmid = vtiger_crmentity.crmid)
WHERE ($tablename.crmid IN (". generateQuestionMarks($recordIds).")) OR ($tablename.relcrmid IN (". generateQuestionMarks($recordIds)."))";
WHERE ($tablename.crmid IN (". generateQuestionMarks($recordIds).") AND ($tablename.relmodule = '".$module."'))
OR ($tablename.relcrmid IN (". generateQuestionMarks($recordIds).") AND ($tablename.module = '".$module."'))";
foreach ($recordIds as $key => $recordId) {
array_push($params, $recordId);
}
......
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