Prevent new categories from being created during dry-run

- Do not wipe previous mapping if user went back a step
This commit is contained in:
Nathan Gray 2012-10-22 14:27:17 +00:00
parent caae2ceeae
commit c5373ef82d
2 changed files with 6 additions and 1 deletions

View File

@ -97,6 +97,7 @@
{
// Set this so plugin doesn't do any data changes
$content['dry-run'] = true;
importexport_helper_functions::$dry_run = true;
$this->message .= '<b>' . lang('Import aborted').":</b><br />\n";
$definition_obj->plugin_options = (array)$definition_obj->plugin_options + array('dry_run' => true);
}
@ -105,6 +106,10 @@
{
echo $this->preview($plugin, $file, $definition_obj);
}
else
{
importexport_helper_functions::$dry_run = false;
}
$count = $plugin->import($file, $definition_obj);
}
else

View File

@ -177,7 +177,7 @@ class importexport_wizard_basic_import_csv
$content['field_mapping'][$index] = $best_match;
}
}
} elseif($content['plugin_options']['csv_fields']) {
} elseif(!$content['csv_fields'] && $content['plugin_options']['csv_fields']) {
$content['csv_fields'] = $content['plugin_options']['csv_fields'];
}
return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1);