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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.1, 2.0.2
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Database:
      MySQL
    • Affected Branches:
      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);
       }
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: