Fixed import error.

This commit is contained in:
James Cole 2016-07-20 15:57:42 +02:00
parent 921e2c06f4
commit a4a723cfc6

View File

@ -280,12 +280,14 @@ class CsvImporter implements ImporterInterface
} }
} }
if ($request->get('settings') == 'map') { if ($request->get('settings') == 'map') {
foreach ($all['mapping'] as $index => $data) { if (isset($all['mapping'])) {
$config['column-mapping-config'][$index] = []; foreach ($all['mapping'] as $index => $data) {
foreach ($data as $value => $mapId) { $config['column-mapping-config'][$index] = [];
$mapId = intval($mapId); foreach ($data as $value => $mapId) {
if ($mapId !== 0) { $mapId = intval($mapId);
$config['column-mapping-config'][$index][$value] = intval($mapId); if ($mapId !== 0) {
$config['column-mapping-config'][$index][$value] = intval($mapId);
}
} }
} }
} }
@ -302,7 +304,16 @@ class CsvImporter implements ImporterInterface
*/ */
private function doColumnMapping(): bool private function doColumnMapping(): bool
{ {
return $this->job->configuration['column-mapping-complete'] === false; $mapArray = $this->job->configuration['column-do-mapping'] ?? [];
$doMap = false;
foreach ($mapArray as $value) {
if ($value === true) {
$doMap = true;
break;
}
}
return $this->job->configuration['column-mapping-complete'] === false && $doMap;
} }
/** /**