You are here

public function RelationsCiviCrmImportSettings::configFormValidate in CRM Core 7

Validation handler for configForm().

Overrides RelationsImportSettingsBase::configFormValidate

File

modules/crm_core_data_import/plugins/settings/RelationsCiviCrmImportSettings.inc, line 131

Class

RelationsCiviCrmImportSettings

Code

public function configFormValidate(&$form, &$form_state, $importer) {
  $relation_settings =& $form_state['values']['relations'];
  if (!empty($relation_settings['relations_values'])) {
    foreach ($relation_settings['relations_values'] as &$relation) {
      if ($this
        ->needCreateRelationInstance($relation)) {
        if (empty($relation['new_relation_name'])) {
          form_set_error('relations[relations_values][' . $relation['id'] . '][relation_type]', t('Relationship name cannot be empty.'));
        }
      }
    }
  }
}