1 config.admin.inc config_import_full_form_submit(array &$form, array &$form_state)

Submit handler for config_import_full_form().


core/modules/config/config.admin.inc, line 244
Admin page callbacks for the Configuration Management module.


function config_import_full_form_submit(array &$form, array &$form_state) {
  if ($fid = $form_state['values']['import_tarball']) {
    // Empty out the existing staging directory.
    $config_storage = config_get_config_storage('staging');

    // Convert the file URI to a file path that is readable by ArchiverTar.
    $file = file_load($fid);
    try {
    catch (\ConfigStorageException $e) {
      form_set_error('import_tarball', t('Could not extract the contents of the tar file. The error message is "@message".', array('@message' => $e->getMessage())));

    // Compare the files to see if any config actually differs.
    $config_statuses = array_filter(config_get_statuses());
    if (empty($config_statuses)) {
      backdrop_set_message(t('The uploaded configuration matches the current site configuration exactly. No changes were made.'), 'warning');
    else {
      backdrop_set_message(t('Your configuration files were successfully uploaded. You may view the differences below. Import into your site by using the "Import all" button.'));
      $form_state['redirect'] = 'admin/config/development/configuration';