CRM - 17471 Fix Issue where updated status labels aren't displayed in search
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 31 Oct 2015 23:09:12 +0000 (23:09 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 3 Nov 2015 04:27:27 +0000 (04:27 +0000)
CRM-17471 Fix issue where updated statuses aren't represented in PseudoConstant, by flushing the cache

Change membershipStatus psuedoConstant to use label column not name

Alter buildSearchForm rather than PseudoConstant to be more safe

CRM/Member/BAO/MembershipStatus.php
CRM/Member/BAO/Query.php

index 4621a0b8f48f3e21fcf6635d88c8b3152f900539..3ecd8ab164ff020fa9f14e6b65c6d242469b6b99 100644 (file)
@@ -148,6 +148,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
     $membershipStatus->id = $id;
 
     $membershipStatus->save();
+    CRM_Member_PseudoConstant::flush('membershipStatus');
     return $membershipStatus;
   }
 
@@ -207,6 +208,7 @@ class CRM_Member_BAO_MembershipStatus extends CRM_Member_DAO_MembershipStatus {
     $membershipStatus = new CRM_Member_DAO_MembershipStatus();
     $membershipStatus->id = $membershipStatusId;
     $membershipStatus->delete();
+    CRM_Member_PseudoConstant::flush('membershipStatus');
     $membershipStatus->free();
   }
 
index 032f5a466e4c1d81295241cc37df70e0fb3ee18c..0fff4dc3cb54423534ed61f8d30e3c4843894173 100644 (file)
@@ -396,7 +396,7 @@ class CRM_Member_BAO_Query {
    * @param CRM_Core_Form $form
    */
   public static function buildSearchForm(&$form) {
-    $membershipStatus = CRM_Member_PseudoConstant::membershipStatus();
+    $membershipStatus = CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label', FALSE, FALSE);
     $form->add('select', 'membership_status_id', ts('Membership Status(s)'), $membershipStatus, FALSE,
       array('id' => 'membership_status_id', 'multiple' => 'multiple', 'class' => 'crm-select2')
     );