Remove duplicate setting of variables
authoreileen <emcnaughton@wikimedia.org>
Fri, 15 Feb 2019 03:39:55 +0000 (16:39 +1300)
committereileen <emcnaughton@wikimedia.org>
Sun, 17 Feb 2019 22:43:03 +0000 (11:43 +1300)
CRM/Contact/BAO/Query.php

index 0a1ba6f5910bceeefe73cad78239b222d5d31f7b..add935859d3aba2d9d0022137f03a9fb05e85e65 100644 (file)
@@ -6544,7 +6544,8 @@ AND   displayRelType.is_active = 1
    * @return array
    */
   protected function addBasicStatsToSummary(&$summary, $where, $from) {
-    $summary['total']['count'] = $summary['total']['amount'] = $summary['total']['avg'] = "n/a";
+    $summary['total']['count'] = 0;
+    $summary['total']['amount'] = $summary['total']['avg'] = [];
 
     $query = "
       SELECT COUNT( conts.total_amount ) as total_count,
@@ -6562,8 +6563,6 @@ AND   displayRelType.is_active = 1
 
     $dao = CRM_Core_DAO::executeQuery($query);
 
-    $summary['total']['count'] = 0;
-    $summary['total']['amount'] = $summary['total']['avg'] = [];
     while ($dao->fetch()) {
       $summary['total']['count'] += $dao->total_count;
       $summary['total']['amount'][] = CRM_Utils_Money::format($dao->total_amount, $dao->currency);