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

Leading spaces causes ERROR when uploading users via CSV

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1.  Login as admin
      2. Go to Dashboard > Site administration > Users > Accounts > Upload users
      3. Create a CSV file :
        1. First line of CSV file looks like : username,password,firstname,lastname,email,course1, group1   (Note the space before group1)
        2. Enter random data for 1 or 2 users for each header field.
      4. Upload it on the page we get at step 2
      5. Click on the "Upload Users" button below
      6. Users data should be uploaded and displayed without any error
      Show
       Login as admin Go to Dashboard > Site administration > Users > Accounts > Upload users Create a CSV file : First line of CSV file looks like : username,password,firstname,lastname,email,course1, group1   (Note the space before group1) Enter random data for 1 or 2 users for each header field. Upload it on the page we get at step 2 Click on the "Upload Users" button below Users data should be uploaded and displayed without any error
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull 3.5 Branch:
      MDL-64959_35_STABLE
    • Pull Master Branch:
      MDL-64959_master

      Description

      I noticed when uploading a users CSV that I accidentally left a space before the “group1” heading in the CSV.

      The error message says ‘“group1” is an invalid header’ which was quite confusing since the extra space was not clearly visible in the message.

        Attachments

          Activity

            People

            Assignee:
            abhikr Abhimanyu Kumar
            Reporter:
            tallthom Thom Rawson
            Peer reviewer:
            Luca Bösch
            Integrator:
            Adrian Greeve
            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:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/May/19

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h