From 7719860b60eacd2e05aebe3c0e04002caca7cd05 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Wed, 11 Mar 2009 02:42:28 +0000 Subject: [PATCH] "ADMINLIB/MDL-17966, display changes saved in admin page, merged from 1.9" --- lib/adminlib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/adminlib.php b/lib/adminlib.php index 89852600e2..a4b6fc56b8 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -2427,7 +2427,7 @@ class admin_setting_special_frontpagedesc extends admin_setting { $record->id = SITEID; $record->{$this->name} = $data; $record->timemodified = time(); - return($DB->update_record('course', $record) ? '' : get_string('errorsetting', 'admin')); + return ($DB->update_record('course', $record) ? '' : get_string('errorsetting', 'admin')); } public function output_html($data, $query='') { @@ -4269,7 +4269,11 @@ function admin_write_settings($formdata) { $adminroot->errors[$fullname]->id = $setting->get_id(); $adminroot->errors[$fullname]->error = $error; } - if ($original !== serialize($setting->get_setting())) { + // $SITE didn't update synchronously, and we shouldn't + // update in this loop (expensive to do this). $SITE will + // be updated at the end of this function, see MDL-17966 + // if ($original !== serialize($setting->get_setting())) { + if ($original !== serialize($data[$fullname])) { $count++; $callbackfunction = $setting->updatedcallback; if (function_exists($callbackfunction)) { -- 2.39.5