-- CRM-15475, Used Contribution status Pseudoconstant to fetch id rather then using...
authorPradeep Nayak <pradpnayak@gmail.com>
Mon, 3 Nov 2014 05:28:03 +0000 (10:58 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Mon, 3 Nov 2014 06:02:32 +0000 (11:32 +0530)
----------------------------------------
* CRM-15475: Fatal error on membership page if membership status 'Cancelled' is disabled
  https://issues.civicrm.org/jira/browse/CRM-15475

CRM/Member/BAO/Query.php

index 6bcb8008327c94ebac057d3afbc934a1815f4256..b15aec999a1a79ca8ff775555eee809f9c1a1bee 100644 (file)
@@ -253,11 +253,9 @@ class CRM_Member_BAO_Query {
           $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause(
             "ccr.contribution_status_id",
             $op,
-            CRM_Core_DAO::getFieldValue(
-              'CRM_Core_DAO_OptionValue',
-              'Cancelled',
-              'value',
-              'name'
+            array_search(
+              'Cancelled', 
+              CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name')
             ),
             "Integer"
           );