MDL-87321 courseformat: explicit empty string check renaming module.
This commit is contained in:
@@ -79,9 +79,10 @@ class cmactions extends baseactions {
|
||||
$paramcleaning = empty($CFG->formatstringstriptags) ? PARAM_CLEANHTML : PARAM_TEXT;
|
||||
$name = clean_param($name, $paramcleaning);
|
||||
|
||||
if (empty($name)) {
|
||||
if ($name === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (core_text::strlen($name) > 1333) {
|
||||
throw new moodle_exception('maximumchars', 'moodle', '', 1333);
|
||||
}
|
||||
@@ -103,10 +104,8 @@ class cmactions extends baseactions {
|
||||
'timemodified' => time(),
|
||||
]
|
||||
);
|
||||
$cm->name = $name;
|
||||
$fields = new \stdClass();
|
||||
$fields->name = $name;
|
||||
|
||||
$cm->name = $name;
|
||||
\core\event\course_module_updated::create_from_cm($cm)->trigger();
|
||||
|
||||
course_modinfo::purge_course_module_cache($cm->course, $cm->id);
|
||||
|
||||
Reference in New Issue
Block a user