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

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

      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);
       }

            skodak Petr Skoda
            fcbsd Fred Crowson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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