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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.10, 3.6.8, 3.7.4, 3.8.1, 3.9
    • Fix Version/s: 3.7.5, 3.8.2
    • Component/s: Enrolments
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull 3.7 Branch:
    • Pull 3.8 Branch:
    • Pull Master Branch:
      MDL-67945-master

      Description

      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);

       

       

        Attachments

          Activity

            People

            Assignee:
            anthonyforth Anthony Forth
            Reporter:
            anthonyforth Anthony Forth
            Peer reviewer:
            Ferran Recio
            Integrator:
            Sara Arjona (@sarjona)
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Mar/20

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h