-- added form rule for CRM-12233
authorPradeep Nayak <pradeep@pradeep.(none)>
Tue, 2 Apr 2013 10:37:55 +0000 (16:07 +0530)
committerPradeep Nayak <pradeep@pradeep.(none)>
Tue, 2 Apr 2013 10:37:55 +0000 (16:07 +0530)
CRM/Contribute/Form/Contribution/Main.php

index 59bd4a8739a37a295f4760170733f849c134fe3c..ac6c9e1b22bd341df7430391b2ada7b5887598c7 100644 (file)
@@ -833,8 +833,9 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
           }
         }
 
-        if ($membershipFieldId && (!CRM_Utils_Array::value('price_' . $contributionFieldId, $fields)
-          && !CRM_Utils_Array::value('price_' . $otherFieldId, $fields))) {
+        if ($membershipFieldId && !(CRM_Utils_Array::value('price_' . $contributionFieldId, $fields)
+          && $fields['price_' . $contributionFieldId] >= 0)
+          && !CRM_Utils_Array::value('price_' . $otherFieldId, $fields)) {
           $errors["price_{$errorKey}"] = ts('Additional Amount is required.');
         }
       }