mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix Undefined variable: result when catch Exception
This commit is contained in:
parent
67d88c824b
commit
759968bbe2
@ -70,6 +70,8 @@ class CsvBulkLoader extends BulkLoader
|
|||||||
$previousDetectLE = ini_get('auto_detect_line_endings');
|
$previousDetectLE = ini_get('auto_detect_line_endings');
|
||||||
|
|
||||||
ini_set('auto_detect_line_endings', true);
|
ini_set('auto_detect_line_endings', true);
|
||||||
|
$result = BulkLoader_Result::create();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$filepath = Director::getAbsFile($filepath);
|
$filepath = Director::getAbsFile($filepath);
|
||||||
$csvReader = Reader::createFromPath($filepath, 'r');
|
$csvReader = Reader::createFromPath($filepath, 'r');
|
||||||
@ -111,8 +113,6 @@ class CsvBulkLoader extends BulkLoader
|
|||||||
$rows = $csvReader->fetchAssoc($headerMap, $remapper);
|
$rows = $csvReader->fetchAssoc($headerMap, $remapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = BulkLoader_Result::create();
|
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$this->processRecord($row, $this->columnMap, $result, $preview);
|
$this->processRecord($row, $this->columnMap, $result, $preview);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user