BUGFIX: keep ModelAdmin from importing data twice (from r101795)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111646 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-04 06:10:33 +00:00
parent dea5cdd64e
commit 171b16e6c9

View File

@ -518,12 +518,10 @@ class ModelAdmin_CollectionController extends Controller {
return false;
}
$results = $loader->load($_FILES['_CsvFile']['tmp_name']);
if (!empty($data['EmptyBeforeImport']) && $data['EmptyBeforeImport']) { //clear database before import
$results = $loader->load($_FILES['_CsvFile']['tmp_name'], '512M', true);
} else { //normal import without clearing
$results = $loader->load($_FILES['_CsvFile']['tmp_name']);
$loader->deleteExistingRecords = true;
}
$results = $loader->load($_FILES['_CsvFile']['tmp_name']);
$message = '';
if($results->CreatedCount()) $message .= sprintf(