Merge branch 'MDL-88080-500' of https://github.com/paulholden/moodle into MOODLE_500_STABLE

This commit is contained in:
Huong Nguyen
2026-03-19 09:11:31 +07:00
3 changed files with 5 additions and 7 deletions
+2 -3
View File
@@ -32,7 +32,6 @@ $adminroot = admin_get_root(); // need all settings here
$adminroot->search = $query; // So we can reference it in search boxes later in this invocation
$statusmsg = '';
$errormsg = '';
$focus = '';
// now we'll deal with the case that the admin has submitted the form with changed settings
if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and $data->action == 'save-settings') {
@@ -41,7 +40,7 @@ if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and
if (!empty($adminroot->errors)) {
$errormsg = get_string('errorwithsettings', 'admin');
$firsterror = reset($adminroot->errors);
$focus = $firsterror->id;
$PAGE->set_focuscontrol($firsterror->id);
} else {
// No errors. Did we change any setting? If so, then redirect with success.
if ($count) {
@@ -55,7 +54,7 @@ $PAGE->set_primary_active_tab('siteadminnode');
// and finally, if we get here, then there are matching settings and we have to print a form
// to modify them
echo $OUTPUT->header($focus);
echo $OUTPUT->header();
// Display a warning if site is not registered.
if (empty($query)) {
+1
View File
@@ -72,6 +72,7 @@ if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and
} else {
$errormsg = get_string('errorwithsettings', 'admin');
$firsterror = reset($adminroot->errors);
$PAGE->set_focuscontrol($firsterror->id);
}
$settingspage = $adminroot->locate($section, true);
}
+2 -4
View File
@@ -35,8 +35,6 @@ if (isset($newsettings['frontpagesettings'])) {
$newsettingshtml = implode($newsettings);
unset($newsettings);
$focus = '';
if (empty($adminroot->errors) and $newsettingshtml === '') {
// there must be either redirect without message or continue button or else upgrade would be sometimes broken
if ($return == 'site') {
@@ -48,12 +46,12 @@ if (empty($adminroot->errors) and $newsettingshtml === '') {
if (!empty($adminroot->errors)) {
$firsterror = reset($adminroot->errors);
$focus = $firsterror->id;
$PAGE->set_focuscontrol($firsterror->id);
}
// and finally, if we get here, then there are new settings and we have to print a form
// to modify them
echo $OUTPUT->header($focus);
echo $OUTPUT->header();
if (!empty($SITE->fullname) and !empty($SITE->shortname)) {
echo $OUTPUT->box(get_string('upgradesettingsintro','admin'), 'generalbox');