MDL-57342 admin: confightml will check if returned data is empty
This commit is contained in:
@@ -2574,6 +2574,19 @@ class admin_setting_confightmleditor extends admin_setting_configtextarea {
|
||||
$editor->use_editor($this->get_id(), array('noclean'=>true));
|
||||
return parent::output_html($data, $query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if data has empty html.
|
||||
*
|
||||
* @param string $data
|
||||
* @return string Empty when no errors.
|
||||
*/
|
||||
public function write_setting($data) {
|
||||
if (trim(html_to_text($data)) === '') {
|
||||
$data = '';
|
||||
}
|
||||
return parent::write_setting($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3378,5 +3378,17 @@ function xmldb_main_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v3.7.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2019052001.03) {
|
||||
// Update the empty tag instructions to null.
|
||||
$instructions = get_config('core', 'auth_instructions');
|
||||
|
||||
if (trim(html_to_text($instructions)) === '') {
|
||||
set_config('auth_instructions', '');
|
||||
}
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2019052001.03);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2019052001.02; // 20190520 = branching date YYYYMMDD - do not modify!
|
||||
$version = 2019052001.03; // 20190520 = branching date YYYYMMDD - do not modify!
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user