From ff33ddc82ea54d271bd9c0f7603cb03455e23074 Mon Sep 17 00:00:00 2001 From: yashodha Date: Thu, 8 Oct 2015 16:36:30 +0530 Subject: [PATCH] CRM-17351: more fixes for unsetting option ---------------------------------------- * CRM-17351: Unable to mark price set field as inactive https://issues.civicrm.org/jira/browse/CRM-17351 --- CRM/Price/Form/Field.php | 2 ++ CRM/Price/Form/Option.php | 1 + 2 files changed, 3 insertions(+) diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 6daeb86f25..55958245cb 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -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'])) { diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php index 050abd9694..434440c441 100644 --- a/CRM/Price/Form/Option.php +++ b/CRM/Price/Form/Option.php @@ -311,6 +311,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form { $params['amount'] = CRM_Utils_Rule::cleanMoney(trim($params['amount'])); $params['price_field_id'] = $this->_fid; $params['is_default'] = CRM_Utils_Array::value('is_default', $params, FALSE); + $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); $ids = array(); if ($this->_oid) { $ids['id'] = $this->_oid; -- 2.25.1