Move TrashedCaluse testing to its own line simplifying empty where test
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 29 Aug 2015 03:30:15 +0000 (03:30 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Sat, 29 Aug 2015 03:30:15 +0000 (03:30 +0000)
CRM/Export/BAO/Export.php

index c101a8298dec4287286ba284324cefe7e015d6e5..a722a3362fa351f4949b5bcc4222f297c6ad7894 100644 (file)
@@ -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";