Merge branch 'MOODLE_38_STABLE_MDL-63795_core_setting_defaults' of https://github.com/mattporritt/moodle into MOODLE_38_STABLE
This commit is contained in:
+4
-2
@@ -8404,10 +8404,12 @@ function admin_get_root($reload=false, $requirefulltree=true) {
|
||||
* @return array $settingsoutput The names and values of the changed settings
|
||||
*/
|
||||
function admin_apply_default_settings($node=null, $unconditional=true, $admindefaultsettings=array(), $settingsoutput=array()) {
|
||||
$counter = 0;
|
||||
|
||||
if (is_null($node)) {
|
||||
core_plugin_manager::reset_caches();
|
||||
$node = admin_get_root(true, true);
|
||||
$counter = count($settingsoutput);
|
||||
}
|
||||
|
||||
if ($node instanceof admin_category) {
|
||||
@@ -8420,7 +8422,7 @@ function admin_apply_default_settings($node=null, $unconditional=true, $admindef
|
||||
|
||||
} else if ($node instanceof admin_settingpage) {
|
||||
foreach ($node->settings as $setting) {
|
||||
if (!$unconditional and !is_null($setting->get_setting())) {
|
||||
if (!$unconditional && !is_null($setting->get_setting())) {
|
||||
// Do not override existing defaults.
|
||||
continue;
|
||||
}
|
||||
@@ -8446,7 +8448,7 @@ function admin_apply_default_settings($node=null, $unconditional=true, $admindef
|
||||
}
|
||||
|
||||
// Call this function recursively until all settings are processed.
|
||||
if (($node instanceof admin_root) && (!empty($admindefaultsettings))) {
|
||||
if (($node instanceof admin_root) && ($counter != count($settingsoutput))) {
|
||||
$settingsoutput = admin_apply_default_settings(null, $unconditional, $admindefaultsettings, $settingsoutput);
|
||||
}
|
||||
// Just in case somebody modifies the list of active plugins directly.
|
||||
|
||||
@@ -1092,7 +1092,7 @@ class mod_forum_mail_testcase extends advanced_testcase {
|
||||
$htmlbase['user']['mailformat'] = 1;
|
||||
$htmlbase['expectations'][0]['contents'] = array(
|
||||
'~{\$a',
|
||||
'~&(amp|lt|gt|quot|\#039);(?!course)',
|
||||
'~&(amp|lt|gt|quot|\#039);(?!course|lang|version|iosappid|androidappid)',
|
||||
'<div class="attachments">( *\n *)?<a href',
|
||||
'<div class="subject">\n.*Hello Moodle', '>Moodle Forum', '>Welcome.*Moodle', '>Love Moodle', '>1\d1');
|
||||
$htmlcases['HTML mail without ampersands, quotes or lt/gt'] = array('data' => $htmlbase);
|
||||
@@ -1121,7 +1121,7 @@ class mod_forum_mail_testcase extends advanced_testcase {
|
||||
$newcase['expectations'][0]['subject'] = '.*101.*HTML text and image';
|
||||
$newcase['expectations'][0]['contents'] = array(
|
||||
'~{\$a',
|
||||
'~&(amp|lt|gt|quot|\#039);(?!course)',
|
||||
'~&(amp|lt|gt|quot|\#039);(?!course|lang|version|iosappid|androidappid)',
|
||||
'<div class="attachments">( *\n *)?<a href',
|
||||
'<div class="subject">\n.*HTML text and image', '>Moodle Forum',
|
||||
'<p>Welcome to Moodle, '
|
||||
|
||||
Reference in New Issue
Block a user