Skip to content

Commit

Permalink
Merge branch 'MDL-78397' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Aug 25, 2023
2 parents 0ce7bf5 + 8ca8c92 commit 928ea71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions course/lib.php
Expand Up @@ -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]);
Expand Down

0 comments on commit 928ea71

Please sign in to comment.