Commit c2299b76 authored by catch's avatar catch
Browse files

Issue #3126940 by Beakerboy, daffie: New DB URI breaks if an existing query...

Issue #3126940 by Beakerboy, daffie: New DB URI breaks if an existing query part is missing the new module parameter

(cherry picked from commit d6f9e2c4)
parent 221ebd25
......@@ -468,7 +468,7 @@ public static function convertDbUrlToConnectionInfo($url, $root) {
$url_components = parse_url($url);
if (isset($url_components['query'])) {
parse_str($url_components['query'], $query);
if ($query['module']) {
if (isset($query['module']) && $query['module']) {
$module = $query['module'];
// Set up an additional autoloader. We don't use the main autoloader as
// this method can be called before Drupal is installed and is never
......
......@@ -188,6 +188,19 @@ public function providerConvertDbUrlToConnectionInfo() {
'autoload' => 'core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/',
],
],
'MySql with a custom query parameter' => [
'',
'mysql://test_user:test_pass@test_host:3306/test_database?extra=value',
[
'driver' => 'mysql',
'username' => 'test_user',
'password' => 'test_pass',
'host' => 'test_host',
'database' => 'test_database',
'port' => 3306,
'namespace' => 'Drupal\Core\Database\Driver\mysql',
],
],
];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment