summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoelpittet2018-04-21 14:43:52 (GMT)
committerLuca Lusso2018-04-21 14:43:52 (GMT)
commit97807ce8f3e3d1e6cb2b65b2c25ee98872834ac8 (patch)
treef9997684b22d7bc3e664ff1744099f7dce7e83bc
parent5c34b0583eb0d37d55a8be4119e48be3148490ec (diff)
Issue #2962196 by joelpittet: Migration page throws Error when webprofiler is installed
-rw-r--r--webprofiler/src/DataCollector/DatabaseDataCollector.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/webprofiler/src/DataCollector/DatabaseDataCollector.php b/webprofiler/src/DataCollector/DatabaseDataCollector.php
index 2c766a4..ddfbab3 100644
--- a/webprofiler/src/DataCollector/DatabaseDataCollector.php
+++ b/webprofiler/src/DataCollector/DatabaseDataCollector.php
@@ -43,8 +43,16 @@ class DatabaseDataCollector extends DataCollector implements DrupalDataCollector
public function collect(Request $request, Response $response, \Exception $exception = NULL) {
$connections = [];
foreach (Database::getAllConnectionInfo() as $key => $info) {
- $database = Database::getConnection('default', $key);
- $connections[$key] = $database->getLogger()->get('webprofiler');
+ try {
+ $database = Database::getConnection('default', $key);
+
+ if ($database->getLogger()) {
+ $connections[$key] = $database->getLogger()->get('webprofiler');
+ }
+ } catch(\Exception $e) {
+ // There was some error during database connection, maybe a stale
+ // configuration in settings.php or wrong values used for a migration.
+ }
}
$this->data['connections'] = array_keys($connections);