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

Upload users from CSV file fails if you have fields that you have created for the profile

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.1, 2.0.2
    • None
    • Administration
    • MySQL
    • MOODLE_20_STABLE

    Description

      If using the upload users function you cannot upload the file if you have created any custom profile fields.

      The bug is caused by the fact that the code for checking Profile fields adds the following to the front of the field:

      'profile_field_'

      The following patch fixes the issue:

      --- uploaduser.php.1.129	Thu Feb 17 14:30:18 2011
      +++ uploaduser.php.my	Thu Feb 17 14:52:04 2011
      @@ -84,7 +84,7 @@
       
       if ($prof_fields = $DB->get_records('user_info_field')) {
           foreach ($prof_fields as $prof_field) {
      -        $PRF_FIELDS[] = 'profile_field_'.$prof_field->shortname;
      +        $PRF_FIELDS[] = $prof_field->shortname;
       
           }
           unset($prof_fields);
       }

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              fcbsd Fred Crowson
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: