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

Cohorts should have idnumbers required when creating and editing.

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 2.4.3
    • Cohorts
    • None
    • MOODLE_24_STABLE
    • Easy

      Cohorts already require unique idnumbers which is good. However, you can create x amount of cohorts each with NO idnumber. This caused a problem when running cron that said:

      Running cron for enrol_cohort...
      !!! Coding error detected, it must be fixed by a programmer: User ID does not exist or is deleted! !!!

      Here is the easy fix:

      open /cohort/edit_form.php
      look for
      public function definition() {

      look for
      $mform->addElement('text', 'idnumber', get_string('idnumber', 'cohort'), 'maxlength="254" size="50"');
      inside that function and add

      $mform->addRule('idnumber', get_string('required'), 'required', null, 'client');

      below it.

      This fixed it for us adding and editing cohorts but I have no idea if there is anywhere else it should be modified OR if the line I have added will break anything else...have removed it for now till you guys decide to use this fix or not...

            skodak Petr Skoda
            aosiname Andrew Osiname
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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