diff --git a/app/Services/ImportExport/FlightImporter.php b/app/Services/ImportExport/FlightImporter.php index da5de9d17..ae1cef2cf 100644 --- a/app/Services/ImportExport/FlightImporter.php +++ b/app/Services/ImportExport/FlightImporter.php @@ -124,10 +124,22 @@ public function import(array $row, $index): bool } // Create/check that they exist - $this->processAirport($row['dpt_airport']); - $this->processAirport($row['arr_airport']); + $process_dep = $this->processAirport($row['dpt_airport']); + if (is_null($process_dep)) { + $this->log('Could not import row '.$index.'. Departure Airport not found!'); + return false; + } + $process_arr = $this->processAirport($row['arr_airport']); + if (is_null($process_arr)) { + $this->log('Could not import row '.$index.'. Arrival Airport not found!'); + return false; + } if ($row['alt_airport']) { - $this->processAirport($row['alt_airport']); + $process_alt = $this->processAirport($row['alt_airport']); + if (is_null($process_alt)) { + $this->log('Could not import row '.$index.'. Alternate Airport not found!'); + return false; + } } // Check/calculate the distance @@ -198,7 +210,7 @@ protected function setDays($day_str) * * @return Airport */ - protected function processAirport($airport): Airport + protected function processAirport($airport): Airport|null { return $this->airportSvc->lookupAirportIfNotFound($airport); } diff --git a/app/Services/ModuleService.php b/app/Services/ModuleService.php index c15a7a1db..930145d4f 100644 --- a/app/Services/ModuleService.php +++ b/app/Services/ModuleService.php @@ -170,7 +170,7 @@ public function addModule($module_name): bool ]); try { - Artisan::call('module:migrate '.$module_name, ['--force' => true]); + Artisan::call('module:migrate '.$module_name); } catch (Exception $e) { Log::error('Error running migration for '.$module_name.'; error='.$e); } @@ -269,7 +269,7 @@ public function installModule(UploadedFile $file): FlashNotifier } Artisan::call('config:cache'); - Artisan::call('module:migrate '.$module, ['--force' => true]); + Artisan::call('module:migrate '.$module); return flash()->success('Module Installed'); } @@ -290,7 +290,7 @@ public function updateModule($id, $status): bool ]); if ($status === true) { - Artisan::call('module:migrate '.$module->name, ['--force' => true]); + Artisan::call('module:migrate '.$module->name); } return true;