mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: keep ModelAdmin from importing data twice
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@101795 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a59fcdd430
commit
b9b4acabaf
@ -515,13 +515,11 @@ class ModelAdmin_CollectionController extends Controller {
|
||||
Director::redirectBack();
|
||||
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(
|
||||
|
Loading…
Reference in New Issue
Block a user