Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-10-12-16-00-15
[civicrm-core.git] / CRM / Price / Form / Field.php
index 7d22dc503c5347a79f36a82a1cdf0a517cf71b72..20c884c93b7508728abfead763a827d4a52b0f4b 100644 (file)
@@ -108,12 +108,14 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
 
       // if text, retrieve price
       if ($defaults['html_type'] == 'Text') {
+        $isActive = $defaults['is_active'];
         $valueParams = array('price_field_id' => $this->_fid);
 
         CRM_Price_BAO_PriceFieldValue::retrieve($valueParams, $defaults);
 
         // fix the display of the monetary value, CRM-4038
         $defaults['price'] = CRM_Utils_Money::format($defaults['amount'], NULL, '%a');
+        $defaults['is_active'] = $isActive;
       }
 
       if (!empty($defaults['active_on'])) {
@@ -654,7 +656,6 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
       //$params['option_description']  = array( 1 => $params['description'] );
       $params['option_weight'] = array(1 => $params['weight']);
       $params['option_financial_type_id'] = array(1 => $params['financial_type_id']);
-      $params['is_active'] = array(1 => 1);
     }
 
     if ($this->_fid) {