Skip to content
Snippets Groups Projects
Commit 235621a0 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#185209 by ChrisKennedy: only provide picture deletion option if there is an...

#185209 by ChrisKennedy: only provide picture deletion option if there is an actual user picture present
parent 856ae39d
Branches
Tags
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
...@@ -1349,7 +1349,7 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) { ...@@ -1349,7 +1349,7 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) {
if (variable_get('user_pictures', 0) && !$register) { if (variable_get('user_pictures', 0) && !$register) {
$form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1); $form['picture'] = array('#type' => 'fieldset', '#title' => t('Picture'), '#weight' => 1);
$picture = theme('user_picture', (object)$edit); $picture = theme('user_picture', (object)$edit);
if ($picture) { if ($edit['picture']) {
$form['picture']['current_picture'] = array('#value' => $picture); $form['picture']['current_picture'] = array('#value' => $picture);
$form['picture']['picture_delete'] = array('#type' => 'checkbox', '#title' => t('Delete picture'), '#description' => t('Check this box to delete your current picture.')); $form['picture']['picture_delete'] = array('#type' => 'checkbox', '#title' => t('Delete picture'), '#description' => t('Check this box to delete your current picture.'));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment