Merge pull request #10999 from nupplaphil/bug/configcache_set
Fix Installer setup
This commit is contained in:
commit
5a9ef594bf
|
@ -385,12 +385,21 @@ class Install extends BaseModule
|
||||||
* @param string $key The key of the setting
|
* @param string $key The key of the setting
|
||||||
* @param null|string $default The default value
|
* @param null|string $default The default value
|
||||||
*/
|
*/
|
||||||
private function checkSetting(Cache $configCache, array $post, $cat, $key, $default = null)
|
private function checkSetting(Cache $configCache, array $post, string $cat, string $key, ?string $default = null)
|
||||||
{
|
{
|
||||||
$configCache->set($cat, $key,
|
$value = null;
|
||||||
trim(($post[sprintf('%s-%s', $cat, $key)] ?? '') ?:
|
|
||||||
($default ?? $configCache->get($cat, $key))
|
if (isset($post[sprintf('%s-%s', $cat, $key)])) {
|
||||||
)
|
$value = trim($post[sprintf('%s-%s', $cat, $key)]);
|
||||||
);
|
}
|
||||||
|
|
||||||
|
if (isset($value)) {
|
||||||
|
$configCache->set($cat, $key, $value, Cache::SOURCE_ENV);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($default)) {
|
||||||
|
$configCache->set($cat, $key, $default, Cache::SOURCE_ENV);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user