MDL-75937 admin: Fixed config data display inconsistency
This commit is contained in:
+50
-2
@@ -1816,7 +1816,7 @@ abstract class admin_setting {
|
||||
global $CFG;
|
||||
|
||||
if (empty($this->plugin)) {
|
||||
if (array_key_exists($this->name, $CFG->config_php_settings)) {
|
||||
if ($this->is_forceable() && array_key_exists($this->name, $CFG->config_php_settings)) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@@ -2160,6 +2160,18 @@ abstract class admin_setting {
|
||||
public function has_custom_form_control(): bool {
|
||||
return $this->customcontrol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the setting can be overridden in config.php.
|
||||
*
|
||||
* Returning true will allow the setting to be defined and overridden in config.php.
|
||||
* Returning false will prevent the config setting from being overridden even when it gets defined in config.php.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_forceable(): bool {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4545,6 +4557,15 @@ class admin_setting_sitesetselect extends admin_setting_configselect {
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* admin_setting_sitesetselect is not meant to be overridden in config.php.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_forceable(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4755,6 +4776,15 @@ class admin_setting_sitesetcheckbox extends admin_setting_configcheckbox {
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* admin_setting_sitesetcheckbox is not meant to be overridden in config.php.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_forceable(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4837,6 +4867,15 @@ class admin_setting_sitesettext extends admin_setting_configtext {
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* admin_setting_sitesettext is not meant to be overridden in config.php.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_forceable(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4912,6 +4951,15 @@ class admin_setting_special_frontpagedesc extends admin_setting_confightmleditor
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* admin_setting_special_frontpagedesc is not meant to be overridden in config.php.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_forceable(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9162,7 +9210,7 @@ function format_admin_setting($setting, $title='', $form='', $description='', $l
|
||||
$context->warning = $warning;
|
||||
$context->override = '';
|
||||
if (empty($setting->plugin)) {
|
||||
if (array_key_exists($setting->name, $CFG->config_php_settings)) {
|
||||
if ($setting->is_forceable() && array_key_exists($setting->name, $CFG->config_php_settings)) {
|
||||
$context->override = get_string('configoverride', 'admin');
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user