dev/core#1603 fix tangental bug on form handling of long options
[civicrm-core.git] / CRM / Price / Form / Field.php
index aed5e90a8d8ec028d836069cdc1ec5a0301dfba2..023066db68b5d84d45d967c9136f389ecbcec976 100644 (file)
@@ -376,13 +376,10 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
       $url = CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=browse&sid=' . $this->_sid);
-      $this->addElement('xbutton',
+      $this->addElement('button',
         'done',
         ts('Done'),
-        [
-          'type' => 'button',
-          'onclick' => "location.href='$url'",
-        ]
+        ['onclick' => "location.href='$url'"]
       );
     }
   }
@@ -645,6 +642,9 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     // 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);