mirror of
https://github.com/moodle/moodle.git
synced 2025-06-02 14:15:11 +02:00
Merge branch 'wip-MDL-41174-master' of git://github.com/abgreeve/moodle
This commit is contained in:
commit
94c9d470d1
@ -1679,6 +1679,12 @@ function set_coursemodule_name($id, $name) {
|
||||
$grademodule->modname = $cm->modname;
|
||||
grade_update_mod_grades($grademodule);
|
||||
|
||||
// Update calendar events with the new name.
|
||||
$refresheventsfunction = $cm->modname . '_refresh_events';
|
||||
if (function_exists($refresheventsfunction)) {
|
||||
call_user_func($refresheventsfunction, $cm->course);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3709,6 +3715,12 @@ function duplicate_module($course, $cm) {
|
||||
moveto_module($newcm, $section, $cm);
|
||||
moveto_module($cm, $section, $newcm);
|
||||
|
||||
// Update calendar events with the duplicated module.
|
||||
$refresheventsfunction = $newcm->modname . '_refresh_events';
|
||||
if (function_exists($refresheventsfunction)) {
|
||||
call_user_func($refresheventsfunction, $newcm->course);
|
||||
}
|
||||
|
||||
// Trigger course module created event. We can trigger the event only if we know the newcmid.
|
||||
$event = \core\event\course_module_created::create_from_cm($newcm);
|
||||
$event->trigger();
|
||||
|
Loading…
x
Reference in New Issue
Block a user