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

Upload users enrolls badly formed users and reports no errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.9
    • Component/s: Enrolments
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      A client had a semi colon and quotes in one user name, causing upload users to fail. Problem is, Moodle reported that all users were enrolled. What actually happened was only some users were enrolled, and the script failed after the bad entry.

      Fix: Moodle should throw an error if Upload users encounters badly formatted file.

      Example file:
      username,password,firstname,lastname,email,course1,role1
      test,demo,fred,jones,user@nowhere.com,FS99,3
      hello,hello,Hello,World,"hello@world.com;
      hello@mail.com",FS99,3"

      The report from this upload reads:

      247 , test User updated

      -->Enrolled in course "FS99"

      User: 249 = hello

      -->Enrolled in course "FS99"

      User: 250 = hello@mail.com\"

      -->Enrolled in course "FS99"

      New users: 2

      Users updated: 1

      Errors: 0

      This is in 1.7+

      The test user actually does not get enrolled, while the two parts of the badly formed user account get both created and enrolled in the FS99 course with roleid #3.

      Fixing the upload script fixed the problem, but it would be great if the report would give an error message, and why does it enroll the broken user accounts?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              michaelp Michael Penney
              Tester:
              Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08