// 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);
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);
}