// store the submitted values in an array
$params = $this->controller->exportValues('Field');
$params['price'] = CRM_Utils_Rule::cleanMoney($params['price']);
+ foreach ($params['option_amount'] as $key => $amount) {
+ $params['option_amount'][$key] = CRM_Utils_Rule::cleanMoney($amount);
+ }
$params['is_display_amounts'] = CRM_Utils_Array::value('is_display_amounts', $params, FALSE);
$params['is_required'] = CRM_Utils_Array::value('is_required', $params, FALSE);
$priceField = CRM_Price_BAO_PriceField::create($params);
if (!is_a($priceField, 'CRM_Core_Error')) {
+ // Required by extensions implementing the postProcess hook (to get the ID of new entities)
+ $this->setEntityId($priceField->id);
CRM_Core_Session::setStatus(ts('Price Field \'%1\' has been saved.', [1 => $priceField->label]), ts('Saved'), 'success');
}
$buttonName = $this->controller->getButtonName();