Skip to content

Commit 93931d2

Browse files
committed
#18075: UI installation fix.
1 parent 7b13705 commit 93931d2

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

setup/src/Magento/Setup/Model/ConfigOptionsList/DriverOptions.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,20 @@ public function getDriverOptions(array $options): array
2626
ConfigOptionsListConstants::KEY_MYSQL_SSL_KEY => ConfigOptionsListConstants::INPUT_KEY_DB_SSL_KEY,
2727
ConfigOptionsListConstants::KEY_MYSQL_SSL_CERT => ConfigOptionsListConstants::INPUT_KEY_DB_SSL_CERT,
2828
ConfigOptionsListConstants::KEY_MYSQL_SSL_CA => ConfigOptionsListConstants::INPUT_KEY_DB_SSL_CA,
29-
ConfigOptionsListConstants::KEY_MYSQL_SSL_VERIFY => ConfigOptionsListConstants::INPUT_KEY_DB_SSL_VERIFY
29+
];
30+
$booleanDriverOptionKeys = [
31+
ConfigOptionsListConstants::KEY_MYSQL_SSL_VERIFY => ConfigOptionsListConstants::INPUT_KEY_DB_SSL_VERIFY,
3032
];
3133
$driverOptions = [];
3234
foreach ($driverOptionKeys as $configKey => $driverOptionKey) {
3335
if ($this->optionExists($options, $driverOptionKey)) {
3436
$driverOptions[$configKey] = $options[$driverOptionKey];
3537
}
3638
}
39+
foreach ($booleanDriverOptionKeys as $configKey => $driverOptionKey) {
40+
$driverOptions[$configKey] = $this->getBooleanValue($options, $driverOptionKey);
41+
}
42+
3743
return $driverOptions;
3844
}
3945

@@ -48,4 +54,18 @@ private function optionExists(array $options, string $driverOptionKey): bool
4854
{
4955
return $options[$driverOptionKey] === false || !empty($options[$driverOptionKey]);
5056
}
57+
58+
/**
59+
* Transforms checkbox flag value into boolean.
60+
*
61+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#value
62+
*
63+
* @param array $options
64+
* @param string $driverOptionKey
65+
* @return bool
66+
*/
67+
private function getBooleanValue(array $options, string $driverOptionKey): bool
68+
{
69+
return isset($options[$driverOptionKey]) ? (bool)$options[$driverOptionKey] : false;
70+
}
5171
}

0 commit comments

Comments
 (0)