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

Wrong enrolment instance can be updated when uploading courses via csv

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 4.3
    • Enrolments
    • MOODLE_403_STABLE

      1. Create course
      2. On enrolment methods page create 2 self enrol instances self1 and self2
      3. Upload csv 

        shortname,fullname,category_idnumber,enrolment_1,enrolment_1_role
        sss,sss,cat1,self,teacher 

         

      1. It will update first instance with smaller id. No way to update second instance

      Same for cohort enrolment. This is due to this code:

      foreach ($instances as $i) {
          if ($i->enrol == $enrolmethod) {
              $instance = $i;
              break;
          }
      } 

      it finds first available of given enrol plugin and updates it. Needs to be more smart to validate it updates correct instance.

      May be its not critical for self since its uncommon to have several instances. but for cohort enrolment might be too easy to mess up enrol instance since it doesn't check for cohort name just checks that enrol plugin type is same

      Not sure how to identify uniquely self enrol instance. But for cohort we can use cohortid instead of name since cohortid is unique (must be set though in cohort setting - its not a  compulsory field)

       

            Unassigned Unassigned
            ilyatregubov Ilya Tregubov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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