}
}
- if (!empty($fields['is_recur'])) {
- if ($fields['frequency_interval'] <= 0) {
- $errors['frequency_interval'] = ts('Please enter a number for how often you want to make this recurring contribution (EXAMPLE: Every 3 months).');
- }
- if ($fields['frequency_unit'] == '0') {
- $errors['frequency_unit'] = ts('Please select a period (e.g. months, years ...) for how often you want to make this recurring contribution (EXAMPLE: Every 3 MONTHS).');
- }
- }
+ //CRM-16285 - Function to handle validation errors on form, for recurring contribution field.
+ CRM_Contribute_BAO_ContributionRecur::validateRecurContribution($fields, $files, $self, $errors);
if (!empty($fields['is_recur']) &&
- CRM_Utils_Array::value('payment_processor', $fields) == 0
+ CRM_Utils_Array::value('payment_processor_id', $fields) == 0
) {
$errors['_qf_default'] = ts('You cannot set up a recurring contribution if you are not paying online by credit card.');
}