From 7347971fdf50e85018f399030fee8621ed3de239 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Thu, 15 Oct 2015 16:45:22 +0530 Subject: [PATCH] CRM-17396 fix - Editing a membership price set breaks auto-renew functionality https://issues.civicrm.org/jira/browse/CRM-17396 --- CRM/Price/Form/Field.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 20c884c93b..14c81e7178 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -606,7 +606,6 @@ class CRM_Price_Form_Field extends CRM_Core_Form { // store the submitted values in an array $params = $this->controller->exportValues('Field'); - $params['name'] = CRM_Utils_String::titleToVar($params['label']); $params['is_display_amounts'] = CRM_Utils_Array::value('is_display_amounts', $params, FALSE); $params['is_required'] = CRM_Utils_Array::value('is_required', $params, FALSE); $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); @@ -635,6 +634,10 @@ class CRM_Price_Form_Field extends CRM_Core_Form { if ($this->_fid) { $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $this->_fid, 'weight', 'id'); } + else { + //CRM-17396, fetch name from label only on adding price field, not on update + $params['name'] = CRM_Utils_String::titleToVar($params['label']); + } $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_PriceField', $oldWeight, $params['weight'], $fieldValues); } -- 2.25.1