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