2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
$sandbox['max']=db_query("SELECT COUNT(*) FROM {users} WHERE picture <> ''")->fetchField();
}
// As a batch operation move the photos into the {files} table and update the
// {user} records.
$limit=500;
$result=db_query_range("SELECT uid, picture FROM {users} WHERE picture <> '' AND uid > :uid ORDER BY uid",array(':uid'=>$sandbox['last_user_processed']),0,$limit);
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'))));
}
elseif($file!==NULL){
$form_state['values']['picture_upload']=$file;
}
}
...
...
@@ -604,13 +627,36 @@ function user_perm() {
*
* Ensure that user pictures (avatars) are always downloadable.
$form['picture']['picture_delete']=array('#type'=>'checkbox','#title'=>t('Delete picture'),'#description'=>t('Check this box to delete your current picture.'));
$form['picture']['picture_upload']=array('#type'=>'file','#title'=>t('Upload picture'),'#size'=>48,'#description'=>t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.',array('%dimensions'=>variable_get('user_picture_dimensions','85x85'),'%size'=>variable_get('user_picture_file_size','30'))).' '.variable_get('user_picture_guidelines',''));
$form['picture']=array(
'#type'=>'fieldset',
'#title'=>t('Picture'),
'#weight'=>1,
);
$form['picture']['picture']=array(
'#type'=>'value',
'#value'=>$edit['picture'],
);
$form['picture']['picture_current']=array(
'#markup'=>theme('user_picture',(object)$edit),
);
$form['picture']['picture_delete']=array(
'#type'=>'checkbox',
'#title'=>t('Delete picture'),
'#access'=>!empty($edit['picture']->fid),
'#description'=>t('Check this box to delete your current picture.'),
);
$form['picture']['picture_upload']=array(
'#type'=>'file',
'#title'=>t('Upload picture'),
'#size'=>48,
'#description'=>t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.',array('%dimensions'=>variable_get('user_picture_dimensions','85x85'),'%size'=>variable_get('user_picture_file_size','30'))).' '.variable_get('user_picture_guidelines',''),