Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-80599

Provided password is ignored when uploading course via csv

XMLWordPrintable

      1. Upload a csv with data like 

        shortname,fullname,category_idnumber,enrolment_1,enrolment_1_password
        C1,Course 1,CAT1,self,testtest
         

      1. It should created a new course with self enrolment method enabled and The course enrolment key for method should be set as per https://docs.moodle.org/403/en/Upload_courses

      Actual: Method is created with empty password

      problem is that it creates a default instance: 

      // Create a new instance if necessary.
      if (empty($instance) && $plugin->can_add_instance($course->id)) {
          $error = $plugin->validate_plugin_data_context($method, $course->id);
          if ($error) {
              $this->error('contextnotallowed', $error);
              break;
          }
          $instanceid = $plugin->add_default_instance($course); 

       

      And then it doesn't update it with provided password - there is a place in code where it does it for startdate, enddate, enrolperiod etc so we need to add password handling there as well

       

       

            ilyatregubov Ilya Tregubov
            ilyatregubov Ilya Tregubov
            Luca Bösch Luca Bösch
            Shamim Rezaie Shamim Rezaie
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 1 hour, 8 minutes
                4d 1h 8m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.