Skip to content

Commit

Permalink
[BUGFIX] Abort CLI installation when no databases are available.
Browse files Browse the repository at this point in the history
Note: This patch doesn't make the command be on feature-parity
with the web-based installer. CLI bails out when the DB doesn't exist;
web is able to create non-existant DB at this stage. This would need
implementation as a follow-up feature.

This patch only addresses not raising an exception on CLI installation.

Resolves: #102322
Releases: main, 12.4
Change-Id: Ic71c71669b010d4fc8e9cb9f229cbdb191dbbee8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81779
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
fe-hicking authored and lolli42 committed Nov 20, 2023
1 parent 270bb3f commit e1b2da2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions typo3/sysext/install/Classes/Command/SetupCommand.php
Expand Up @@ -277,6 +277,11 @@ protected function selectAndImportDatabase(QuestionHelper $questionHelper, Input
return Command::FAILURE;
}

if ($databaseList === []) {
$this->writeError($output, 'No databases are available to the specified user. At least one usable database needs to be accessible.');
return Command::FAILURE;
}

$dbChoices = [];
foreach ($databaseList as $database) {
$usable = $database['tables'] > 0 ? '<fg=red>☓</>' : '<fg=green>✓</>';
Expand Down

0 comments on commit e1b2da2

Please sign in to comment.