From 17bc4f1bc297d7fa640f3d5f0a0d8b1017a19cf5 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 29 Aug 2015 03:30:15 +0000 Subject: [PATCH] Move TrashedCaluse testing to its own line simplifying empty where test --- CRM/Export/BAO/Export.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index c101a8298d..a722a3362f 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -606,11 +606,13 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c $excludeTrashed = FALSE; } } - if (empty($where) && $excludeTrashed) { - $where = "WHERE contact_a.is_deleted != 1"; + $trashClause = $excludeTrashed ? "contact_a.is_deleted != 1" : "( 1 )"; + + if (empty($where) { + $where = "WHERE $trashClause"; } - elseif ($excludeTrashed) { - $where .= " AND contact_a.is_deleted != 1"; + else { + $where .= " AND $trashClause"; } $queryString = "$select $from $where $having"; -- 2.25.1