MDL-69156 course_copy: set defaults for idnumber when not permitted
authorAdrian Perez <adrian.perez@ffhs.ch>
Sat, 27 Jun 2020 08:22:36 +0000 (10:22 +0200)
committerAdrian Perez <adrian.perez@ffhs.ch>
Thu, 29 Oct 2020 13:14:08 +0000 (14:14 +0100)
backup/util/ui/classes/output/copy_form.php

index 6856101..dec99e4 100644 (file)
@@ -158,6 +158,7 @@ class copy_form extends \moodleform {
         $mform->setType('idnumber', PARAM_RAW);
         if (!empty($course->id) and !has_capability('moodle/course:changeidnumber', $coursecontext)) {
             $mform->hardFreeze('idnumber');
+            $mform->setDefault('idnumber', '');
             $mform->setConstants('idnumber', $course->idnumber);
         }