From 34b773b78eb4f1c025fd4865902788ea6c6173fe Mon Sep 17 00:00:00 2001 From: kurund Date: Mon, 26 Aug 2013 21:11:13 +0530 Subject: [PATCH] CRM-12638, do not use caching table if 'select all' option is used ---------------------------------------- * CRM-12638: Optimize Prev/Next Cache and search interaction http://issues.civicrm.org/jira/browse/CRM-12638 --- CRM/Export/BAO/Export.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index e72de417df..e373ca6298 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -370,9 +370,7 @@ class CRM_Export_BAO_Export { } } - if ($componentTable && - CRM_Utils_Array::value('additional_group', $exportParams) - ) { + if (!$selectAll && $componentTable && CRM_Utils_Array::value('additional_group', $exportParams)) { // If an Additional Group is selected, then all contacts in that group are // added to the export set (filtering out duplicates). $query = " @@ -496,10 +494,10 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c } $relationshipJoin = $relationshipClause = ''; - if ($componentTable) { - $relationshipJoin = " INNER JOIN $componentTable ctTable ON ctTable.contact_id = {$contactA}"; + if (!$selectAll && $componentTable) { + $relationshipJoin = " INNER JOIN {$componentTable} ctTable ON ctTable.contact_id = {$contactA}"; } - else { + elseif (!empty($relIDs)) { $relID = implode(',', $relIDs); $relationshipClause = " AND crel.{$contactA} IN ( {$relID} )"; } @@ -539,7 +537,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c ); } - if ($componentTable) { + if (!$selectAll && $componentTable) { $from .= " INNER JOIN $componentTable ctTable ON ctTable.contact_id = contact_a.id "; } elseif ($componentClause) { -- 2.25.1