Index: avatar_selection.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/avatar_selection/avatar_selection.module,v retrieving revision 1.1.2.22.2.29 diff -u -r1.1.2.22.2.29 avatar_selection.module --- avatar_selection.module 12 Apr 2008 21:49:40 -0000 1.1.2.22.2.29 +++ avatar_selection.module 18 Apr 2008 11:06:22 -0000 @@ -304,26 +304,7 @@ $file = file_save_upload('picture_upload', $validators); - if ($file) { - // Remove the old picture. - if (isset($form_state['values']['_account']->picture) && file_exists($form_state['values']['_account']->picture)) { - file_delete($form_state['values']['_account']->picture); - } - - // The image was saved using file_save_upload() and was added to the - // files table as a temporary file. We'll make a copy and let the - // garbage collector delete the original upload. - $info = image_get_info($file->filepath); - $destination = variable_get('user_picture_path', 'pictures') .'/picture-'. $form['#uid'] .'.'. $info['extension']; - if (file_copy($file, $destination, FILE_EXISTS_REPLACE)) { - $form_state['values']['picture'] = $file->filepath; - } - else { - form_set_error('picture_upload', t("Failed to upload the picture image; the %directory directory doesn't exist or is not writable.", array('%directory' => variable_get('user_picture_path', 'pictures')))); - } - } - - else if (!$file && !empty($form_state['values']['select_avatar'])) { + if (!$file && !empty($form_state['values']['select_avatar'])) { $path = file_create_path('avatar_selection') .'/'; $form_state['values']['picture'] = $path . $form_state['values']['select_avatar']; }