Would it be possible to add an additional field to allow importing the user photo path from the text file? Right now I am uploading a bunch of images labeled by usernames and setting the path by editing an sql dump of the user table. This would help immensely. Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Robert Castelo’s picture

This sounds interesting, but can't see how it would hang together.

Where do the images get uploaded?
- a directory in the user_import module directory? Somewhere else?

How do you put the filepath for each image into the csv file?

coupet’s picture

yes, if picture support is enabled in user settings.

use Picture image path (specified by admin)
Subdirectory in the directory files/ where pictures will be stored.

Jackinloadup’s picture

Does anyone know a way to do picture imports? specifying a file path seems to be the most logical.

jrglasgow’s picture

I wrote a patch to add some picture support - upload the pictures to the site user pictures directory. Have a field with the file name.

When the users are imported

/**
 * Import the picture data
 */
function user_user_import_picture_date($data, $settings = array()) {
  // the site file directory, system user picture directory are prepended to the file name
  return file_directory_path() . '/' . variable_get('user_picture_path', 'pictures') . '/' . $data;
}

if you have files in a directory within the pictures directory then that directory needs to prepend to the file name in your csv file

jwilson3’s picture

Version: master » 6.x-4.x-dev
Issue summary: View changes
FileSize
1.59 KB

RTBC. Patch from #4 works perfectly, except that it just needed a re-roll.

jwilson3’s picture

Status: Active » Reviewed & tested by the community
gisle’s picture

Version: 6.x-4.x-dev » 7.x-3.x-dev
Status: Reviewed & tested by the community » Needs work

Needs to be re-rolled for most recent version.