Skip to content

Commit

Permalink
Fixed undefined output
Browse files Browse the repository at this point in the history
  • Loading branch information
coastforge-mei committed May 15, 2024
1 parent 48de55c commit 2146ca5
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/Classes/C4GImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ public function importBaseData($importId = false, $output = false)
$deleted = $this->deleteBaseData($importId, true, true);
if (!$deleted) {
$this->importRunning(false, $con4gisImportId);
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['errorDeleteImports']);
if ($output) {
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['errorDeleteImports']);
}
C4gLogModel::addLogEntry('core', 'Error deleting old import data for automatic import. Stopped Import');
PageRedirect::redirect('/contao?do=c4g_io_data');
return false;
Expand All @@ -330,7 +332,9 @@ public function importBaseData($importId = false, $output = false)
$deleted = $this->deleteBaseData(false, true, true);
if (!$deleted) {
$this->importRunning(false, $con4gisImportId);
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['errorDeleteImports']);
if ($output) {
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['errorDeleteImports']);
}
PageRedirect::redirect('/contao?do=c4g_io_data');
return false;
}
Expand Down Expand Up @@ -455,15 +459,22 @@ public function importBaseData($importId = false, $output = false)
$deleted = $this->deleteBaseData($importId, true, true);
if (!$deleted) {
$this->importRunning(false, $con4gisImportId);
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['errorDeleteImports']);

if ($output) {
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['errorDeleteImports']);
}

return false;
}
} elseif ($importDataType == 'full') {
$deleted = $this->deleteBaseData(false, true, true);
if (!$deleted) {
$this->importRunning(false, $con4gisImportId);
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['errorDeleteImports']);

if ($output) {
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['errorDeleteImports']);
}

PageRedirect::redirect('/contao?do=c4g_io_data');

return false;
Expand Down Expand Up @@ -522,7 +533,9 @@ public function importBaseData($importId = false, $output = false)

if (!$sqlStatements) {
C4gLogModel::addLogEntry('core', 'Error inserting/updating in database');
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['importError']);
if ($output) {
$ouput->writeln($GLOBALS['TL_LANG']['tl_c4g_import_data']['importError']);
}
$this->importRunning(false, $con4gisImportId);
if (!$importId) {
$objFolder = new Folder('files/con4gis_import_data/io-data/');
Expand Down Expand Up @@ -588,7 +601,7 @@ public function importBaseData($importId = false, $output = false)
$dispatcher->dispatch($event, $event::NAME);
$error = $event->getError();

if ($error) {
if ($error && $output) {
$ouput->writeln($error);
}

Expand Down

0 comments on commit 2146ca5

Please sign in to comment.