You are here

function hansel_export_import_form_validate in Hansel breadcrumbs 7

Same name and namespace in other branches
  1. 8 export/hansel_export.module \hansel_export_import_form_validate()

Form validate callback.

File

export/hansel_export.module, line 121

Code

function hansel_export_import_form_validate($form, &$form_state) {
  $config = $form_state['values']['config'];
  $config = trim($config);
  if (!@unserialize($config)) {
    form_set_error('config', t('Unable to read configuration.'));
  }
  if (!isset($config['version'])) {
    form_set_error('config', t('Unable to read configuration.'));
  }
  if ($config['version'] > 1) {
    form_set_error('config', t('Unable to import configuration. The export version is newer than the current version of Hansel.'));
  }
}