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

Restoring a course with self enrolment and cohort restrictions enabled throws an error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.7.5, 3.8.2
    • 3.5.10, 3.6.8, 3.7.4, 3.8.1, 3.9
    • Enrolments
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • MDL-67945-master
    • Hide

      Setup

      1. On a clean site without any cohort created, restore the backup of the course attached to this issue.  It was created using https://sandbox.moodledemo.net/ which is based in master. It has the self-enrolment enrolment method enabled with a cohort in "Only cohort members").
        • If the following message appears, you can ignore it (it will be displayed at least when testing in 3.7): "This backup file has been created with Moodle 3.8.1 and it's newer than your currently installed Moodle 3.7.4+. This could cause some inconsistencies because backwards compatibility of backup files cannot be guaranteed."

      Testing instructions

      1. Go to the restored course.
      2. Access to the Participants page, click the cog and edit the self-enrolment instance.
      3. Check the self-enrolment form is displayed without errors.
      Show
      Setup On a clean site without any cohort created, restore the backup of the course attached to this issue.  It was created using https://sandbox.moodledemo.net/  which is based in master. It has the self-enrolment enrolment method enabled with a cohort in "Only cohort members"). If the following message appears, you can ignore it (it will be displayed at least when testing in 3.7): " This backup file has been created with Moodle 3.8.1 and it's newer than your currently installed Moodle 3.7.4+. This could cause some inconsistencies because backwards compatibility of backup files cannot be guaranteed. " Testing instructions Go to the restored course. Access to the Participants page, click the cog and edit the self-enrolment instance. Check the self-enrolment form is displayed without errors.

      The function edit_instance_form() uses $DB but it isn't declared and throws an error for this -

       

      $c = $DB->get_record('cohort',
      array('id' => $instance->customint5),
      'id, name, idnumber, contextid, visible',
      IGNORE_MISSING);

       

       

            anthonyforth Anthony Forth
            anthonyforth Anthony Forth
            Ferran Recio Ferran Recio
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Anna Carissa Sadia Anna Carissa Sadia
            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 - 2 hours
                2h

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