From 14a08308e09a3f8c67e107bc380a8bedcaa2ca9c Mon Sep 17 00:00:00 2001 From: kurund Date: Mon, 30 Dec 2013 20:09:57 -0800 Subject: [PATCH] patched CRM-13982 - export includes trashed contacts http://issues.civicrm.org/jira/browse/CRM-13982 --- CRM/Export/BAO/Export.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index 1fa49ff04c..cb7f04fcd6 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -549,6 +549,20 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c } } + // CRM-13982 - check if is deleted + $excludeTrashed = TRUE; + foreach ($params as $value) { + if ($value[0] == 'contact_is_deleted') { + $excludeTrashed = FALSE; + } + } + if (empty($where) && $excludeTrashed) { + $where = "WHERE contact_a.is_deleted != 1"; + } + elseif ($excludeTrashed) { + $where .= " AND contact_a.is_deleted != 1"; + } + $queryString = "$select $from $where $having"; $groupBy = ""; -- 2.25.1