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

tool_uploadcourse is not compatible with all enrolment plugins

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      In this test, you will check that you can add, remove, update compatible enrolment methods to new or existing courses using a CSV file

      Test pre-requisites

      • Courses with the default enrolment methods
      • Courses set up with a non-default enrolment method

      Test steps

      1. Create a CSV file such as the following which should:
        • Add an enrolment method that does not exist
        • Add a new non-standard enrolment method (cohort, meta, etc...)
        • Add an enrolment method not available in the courses (database, flatfile, mnet, ...)
        • Delete an enrolment method
        • Update an enrolment method
        • Disable an enrolment method
        • Each of those on an existing, AND a new course
        • It is better to use one line for each test, and note that each line should use a different course

          shortname,fullname,category,enrolment_1,enrolment_1_customint1,enrolment_1_disable,enrolment_1_delete
          CSV1,CSV1,1,cohort,1,,
          CSV2,CSV2,1,donotexist,1,,
          CSV3,CSV3,1,manual,1,,
          CSV4,CSV4,1,database,1,,
          ...
          

      2. Go to Home ► Site administration ► Courses ► Upload courses and create/update the courses.
      3. Make sure that
        • The non-existing enrolment method row was not processed
        • The non-standard enrolment method worked as expected
        • The enrolment method not available in courses caused a warning, but the course was still created/updated
        • All the other actions took effect (delete, disable, update, create) on the methods worked as expected
      4. Repeat using the CLI script.
      Show
      In this test, you will check that you can add, remove, update compatible enrolment methods to new or existing courses using a CSV file Test pre-requisites Courses with the default enrolment methods Courses set up with a non-default enrolment method Test steps Create a CSV file such as the following which should: Add an enrolment method that does not exist Add a new non-standard enrolment method (cohort, meta, etc...) Add an enrolment method not available in the courses (database, flatfile, mnet, ...) Delete an enrolment method Update an enrolment method Disable an enrolment method Each of those on an existing, AND a new course It is better to use one line for each test, and note that each line should use a different course shortname,fullname,category,enrolment_1,enrolment_1_customint1,enrolment_1_disable,enrolment_1_delete CSV1,CSV1,1,cohort,1,, CSV2,CSV2,1,donotexist,1,, CSV3,CSV3,1,manual,1,, CSV4,CSV4,1,database,1,, ... Go to Home ► Site administration ► Courses ► Upload courses and create/update the courses. Make sure that The non-existing enrolment method row was not processed The non-standard enrolment method worked as expected The enrolment method not available in courses caused a warning, but the course was still created/updated All the other actions took effect (delete, disable, update, create) on the methods worked as expected Repeat using the CLI script.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_30_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-43127-master
    • Sprint:
      BACKEND Sprint 18, 3.1 Sprint 7
    • Issue size:
      Large

      Description

      When processing the enrolment data we are calling $plugin->add_default_instance($course) which does not always do something. We should fallback on $plugin->add_instance() when it returns null.

        Attachments

        1. local_history.patch
          0.8 kB
          Nadav Kavalerchik
        2. upload_course.txt
          0.3 kB
          David Monllaó

          Issue Links

            Activity

              People

              • Votes:
                37 Vote for this issue
                Watchers:
                47 Start watching this issue

                Dates

                • Created:
                  Updated: