From: kurund Date: Sat, 28 Feb 2015 13:34:46 +0000 (+0530) Subject: CRM-15756, more fixes for validation X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=340895007c7b07bf41c0b388fffc012cc920d719;p=civicrm-core.git CRM-15756, more fixes for validation ---------------------------------------- * CRM-15756: Back-office Submit Credit Card Contribution form: card # validation is no longer working https://issues.civicrm.org/jira/browse/CRM-15756 --- diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 35ca917350..da3cbdc61e 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -923,6 +923,10 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP if (empty($fields['payment_processor_id'])) { $errors['payment_processor_id'] = ts('Payment Processor is a required field.'); } + else { + // validate payment instrument (e.g. credit card number) + CRM_Core_Payment_Form::validatePaymentInstrument($fields['payment_processor_id'], $fields, $errors, $self); + } } // Do the amount validations. @@ -946,7 +950,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP } //FIXME FOR NEW DATA FLOW http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+4.3+Data+Flow - if (!empty($fields['fee_amount']) && $financialType = CRM_Contribute_BAO_Contribution::validateFinancialType($fields['financial_type_id'])) { + if (!empty($fields['fee_amount']) && !empty($fields['financial_type_id']) && $financialType = CRM_Contribute_BAO_Contribution::validateFinancialType($fields['financial_type_id'])) { $errors['financial_type_id'] = ts("Financial Account of account relationship of 'Expense Account is' is not configured for Financial Type : ") . $financialType; }