Merge pull request #5839 from seamuslee001/CRM-9764-4-6
authorDave Greenberg <dave@civicrm.org>
Tue, 30 Jun 2015 15:01:19 +0000 (08:01 -0700)
committerDave Greenberg <dave@civicrm.org>
Tue, 30 Jun 2015 15:01:19 +0000 (08:01 -0700)
CRM-9764 Ensure all custom searches have ACL - Backport to 4.6

1  2 
CRM/Contact/Form/Search/Custom/ContributionAggregate.php

index eb4ed36ca5a9c3dd9b19d4664a5d669b2bdc9393,61bca05a6f4aa1874d8b6a94eb39ff018eb4cd75..ed46a04fb224e7a705efcd583fc850d79971895c
@@@ -222,9 -228,12 +227,12 @@@ civicrm_contact AS contact_a {$this->_a
      }
  
      if (!empty($this->_formValues['financial_type_id'])) {
 -      $financial_type_ids = implode(',', array_keys($this->_formValues['financial_type_id']));
 +      $financial_type_ids = implode(',', array_values($this->_formValues['financial_type_id']));
        $clauses[] = "contrib.financial_type_id IN ($financial_type_ids)";
      }
+     if ($this->_aclWhere) {
+       $clauses[] = " {$this->_aclWhere} ";
+     }
  
      return implode(' AND ', $clauses);
    }