Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I add picture in profile users. Set path where save file-picture.
2 moments - not correct.
1 - while i himself not create path and set 666 perm. - not work upload (need check - if path not found - created before save)
2 - when create user - upload not work - while i login user and edit his profile - bad very bad
Comments
Comment #1
wowik73 CreditAttribution: wowik73 commentedIf you add in form element file - need add enctype = 'multipart/form-data';
------------------------------------
function profile_pictures_form_alter(&$form, &$form_state, $form_id) {
...
elseif (($form_id == 'user_profile_form') || ($form_id == 'user_register') || ($form_id == 'profile_form_profile')) {
+ $picture = false;
...
if ($field->type != 'picture') {
+ $picture = true;
continue;
}
...
$form['#validate'][] = 'profile_picture_validate';
+ if ($picture)
+ $form['#attributes']['enctype'] = 'multipart/form-data';
Comment #2
wowik73 CreditAttribution: wowik73 commented3 Need add picture options - if not present picture - use this default picture ...
Comment #3
yeputons CreditAttribution: yeputons commentedCreated separate issues: #889222: Automatically picture upload directory creation (if not exists) and #889228: Default picture for field (like in core profile.module).
wowik73, please create separate issues and don't write a lot of requests in one issue.