-- CRM-13400, removed obsolete code and fixed default settting of current membership
authorPradeep Nayak <pradeep@pradeep.(none)>
Tue, 24 Sep 2013 10:57:04 +0000 (16:27 +0530)
committerPradeep Nayak <pradeep@pradeep.(none)>
Tue, 24 Sep 2013 10:57:04 +0000 (16:27 +0530)
----------------------------------------
* CRM-13400: Online membership renewal via contribution page no longer sets existing membership as default
  http://issues.civicrm.org/jira/browse/CRM-13400

CRM/Contribute/Form/Contribution/Main.php

index 1619ca86af118f3a632faebfa135b23ceac7f2b3..358a90de472e636c6d77f5795d0f043352496c86 100644 (file)
@@ -216,11 +216,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       }
     }
 
-    //set default membership for membershipship block
-    if ($this->_membershipBlock) {
-      $this->_defaults['selectMembership'] = $defaultMemType = $this->_defaultMemTypeId ? $this->_defaultMemTypeId : CRM_Utils_Array::value('membership_type_default', $this->_membershipBlock);
-    }
-
     //         // hack to simplify credit card entry for testing
     //         $this->_defaults['credit_card_type']     = 'Visa';
     //         $this->_defaults['amount']               = 168;
@@ -281,7 +276,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
     CRM_Core_BAO_Address::fixAllStateSelects($this, $this->_defaults);
 
     if ($this->_priceSetId) {
-      if ($this->_useForMember && !empty($this->_currentMemberships)) {
+      if (($this->_useForMember && !empty($this->_currentMemberships)) || $this->_defaultMemTypeId) {
         $selectedCurrentMemTypes = array();
         foreach ($this->_priceSet['fields'] as $key => $val) {
           foreach ($val['options'] as $keys => $values) {