mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +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
4c26696e7e
commit
5cc31c3691
@ -116,7 +116,9 @@ class backup_ui_stage_initial extends backup_ui_stage {
|
||||
if (isset($data->$name) && $data->$name != $setting->get_value()) {
|
||||
$setting->set_value($data->$name);
|
||||
$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);
|
||||
$changes++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user