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

Courses Admin CLI Upload Always Sets New Courses to Topics Format

    • 1

      The script at admin/tool/uploadcourse/cli/uploadcourse.php always creates new courses in the Topics format instead of respecting the default setting under Site Admin > Courses > Default course settings.

      To replicate:

      Go to yoursite.com/admin/settings.php?section=coursesettings and change the Format to Weekly (or anything else besides Topics)

      Create a simple course upload CSV file, I used:

      shortname,fullname,category
      Weekly Course, Weekly Course, 1

      Go to Site Admin > Courses > Upload Courses and upload the file in create mode. Note the course defaults are populated into the UI under the "Default Course Values' heading 

      Create the course and verify it is weekly format.

      Delete the course.

      Access your site root via SSH and run the script in createnew mode or createorupdate mode with update mode allowing defaults

      sudo -u www-data php /var/www/html/moodle40/admin/tool/uploadcourse/cli/uploadcourse.php --mode=createnew --file=/home/ben/courseupload.csv

      Observe the course is in Topics format

        

       

       

       

       

       

            artonieminen Arto Nieminen
            benkahn1 Ben Kahn
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 minutes
                5m

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