mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-16171 - Allow mdd/xxx/defaults.php to load data into the config_plugins table.
This commit is contained in:
parent
f6812a21cf
commit
220a5c8721
@ -685,9 +685,19 @@ function upgrade_activity_modules($return) {
|
||||
unset($defaults);
|
||||
include($fullmod .'/defaults.php'); // include here means execute, not library include
|
||||
if (!empty($defaults)) {
|
||||
foreach ($defaults as $name => $value) {
|
||||
if (!isset($CFG->$name)) {
|
||||
set_config($name, $value);
|
||||
if (!empty($defaults['_use_config_plugins'])) {
|
||||
unset($defaults['_use_config_plugins']);
|
||||
$localcfg = get_config($module->name);
|
||||
foreach ($defaults as $name => $value) {
|
||||
if (!isset($localcfg->$name)) {
|
||||
set_config($name, $value, $module->name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($defaults as $name => $value) {
|
||||
if (!isset($CFG->$name)) {
|
||||
set_config($name, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user