mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Merge branch 'MDL-78397' of https://github.com/paulholden/moodle
This commit is contained in:
commit
928ea71887
@ -3510,10 +3510,9 @@ function duplicate_module($course, $cm, int $sectionid = null, bool $changename
|
||||
// triggering a lot of create/update duplicated events.
|
||||
$newcm = get_coursemodule_from_id($cm->modname, $newcmid, $cm->course);
|
||||
if ($changename) {
|
||||
// Add ' (copy)' to duplicates. Note we don't cleanup or validate lengths here. It comes
|
||||
// from original name that was valid, so the copy should be too.
|
||||
// Add ' (copy)' language string postfix to duplicated module.
|
||||
$newname = get_string('duplicatedmodule', 'moodle', $newcm->name);
|
||||
$DB->set_field($cm->modname, 'name', $newname, ['id' => $newcm->instance]);
|
||||
set_coursemodule_name($newcm->id, $newname);
|
||||
}
|
||||
|
||||
$section = $DB->get_record('course_sections', ['id' => $sectionid ?? $cm->section, 'course' => $cm->course]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user