From: Pradeep Nayak Date: Tue, 2 Apr 2013 10:37:55 +0000 (+0530) Subject: -- added form rule for CRM-12233 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f55fb3353651a64033ff0d4dfad3e5f6cbe87f81;p=civicrm-core.git -- added form rule for CRM-12233 --- diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 59bd4a8739..ac6c9e1b22 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -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.'); } }