if ($asciiValue >= 48 && $asciiValue <= 57) {
$errors['title'] = ts("Name cannot not start with a digit");
}
+ // CRM-16189
+ if (!empty($fields['extends'])
+ && (array_key_exists(CRM_Core_Component::getComponentID('CiviEvent'), $fields['extends'])
+ || array_key_exists(CRM_Core_Component::getComponentID('CiviMember'), $fields['extends']))
+ ) {
+ try {
+ CRM_Financial_BAO_FinancialAccount::validateFinancialType($fields['financial_type_id']);
+ }
+ catch (CRM_Core_Exception $e) {
+ $errors['financial_type_id'] = $e->getMessage();
+ }
+ }
return empty($errors) ? TRUE : $errors;
}