Skip to content

Commit

Permalink
Fetch tables to check the database connection (see #1698)
Browse files Browse the repository at this point in the history
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes #1631


If the database server allows anonymous connections, the current DB check does not fail as it should. The added `SHOW TABLES` is actually the same procedure already used by the install tool, I have also locally reproduced the problem and this fixes it.

Even though #1631 says the issue only appears in Contao 4.9 (which I can confirm), I think we should also fix/change this in 4.4, as it might be related to a change in Doctrine or Symfony that _could_ somewhen apply to 4.4 as well.

Commits
-------

66732c7 Fetch tables to check the database connection
  • Loading branch information
aschempp committed May 5, 2020
1 parent f798f36 commit 3e0d3cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions manager-bundle/src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public function getExtensionConfig($extensionName, array $extensionConfigs, Plug
try {
$connection = DriverManager::getConnection($params);
$connection->connect();
$connection->query('SHOW TABLES');
$connection->close();
} catch (DriverException $e) {
$extensionConfigs[] = [
Expand Down

0 comments on commit 3e0d3cf

Please sign in to comment.