MDL-85984 admin: verbose CLI info if trying to set hardcoded config.

This commit is contained in:
Paul Holden
2025-09-01 16:17:47 +02:00
parent a1a8af4ca0
commit bddbe33c9c
+4 -1
View File
@@ -128,7 +128,10 @@ if ($options['unset'] || $options['set'] !== null) {
$settinginconfig = array_key_exists($options['name'], $CFG->config_php_settings);
}
if ($settinginconfig) {
cli_error('The configuration variable is hard-set in the config.php, unable to change.', 4);
$variablename = !empty($component)
? "\$CFG->forced_plugin_settings['{$component}']['{$options['name']}']"
: "\$CFG->{$options['name']}";
cli_error("The configuration variable {$variablename} is set in config.php, unable to change.", 4);
}
$new = $options['set'];