mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-67870 backup: Skip value change if setting is locked by hierarchy
The given condition in the if statement did not take into account cases when the setting is locked by hierarchy. Settings which are locked by hierarchy should should keep their current values which were inherited from the parent.
This commit is contained in:
parent
2ad3d1a7f1
commit
47d87f7243
1 changed files with 3 additions and 1 deletions
|
@ -116,7 +116,9 @@ class backup_ui_stage_initial extends backup_ui_stage {
|
||||||
if (isset($data->$name) && $data->$name != $setting->get_value()) {
|
if (isset($data->$name) && $data->$name != $setting->get_value()) {
|
||||||
$setting->set_value($data->$name);
|
$setting->set_value($data->$name);
|
||||||
$changes++;
|
$changes++;
|
||||||
} else if (!isset($data->$name) && $setting->get_ui_type() == backup_setting::UI_HTML_CHECKBOX && $setting->get_value()) {
|
} else if (!isset($data->$name) && $setting->get_value() &&
|
||||||
|
$setting->get_ui_type() == backup_setting::UI_HTML_CHECKBOX &&
|
||||||
|
$setting->get_status() !== backup_setting::LOCKED_BY_HIERARCHY) {
|
||||||
$setting->set_value(0);
|
$setting->set_value(0);
|
||||||
$changes++;
|
$changes++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue