I was using the user delete module and the chgpwd module. The user delete link was showing up under the user/uid/edit/chgpwd page. I patched this by adding an if argument checking for pages under the user edit.

Comments

EvanDonovan’s picture

Category: feature » bug

This seems actually like a bug to me. Will test soon, I think.

Michsk’s picture

This is a bug and a annoying one. For example: http://drupal.org/node/1216874

pdrake’s picture

Status: Needs review » Reviewed & tested by the community

This patch works for me.

sanduhrs’s picture

Status: Reviewed & tested by the community » Fixed

This went into 6.x-1.5.
Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

enricotersi’s picture

hello guys
I have a problem with the 6.x-1.5 version.

if ($form_id == 'user_profile_form') {
    //access check
    if (user_access('delete own account') && $form['#uid'] == $user->uid && arg(3)=='') {
      $form['delete'] = array(
        '#type' => 'submit',
        '#value' => t('Delete Account'),
        '#weight' => 31,
        '#submit' => array('user_edit_delete_submit'),
      );
    }
  }

The button "Delete Account" is gone for all users who are not admin. I noticed on the form that the value of $form['#uid'] is empty and so the button is not shown. How can I fix?
thanks

enricotersi’s picture

fixed

if ($form_id == 'user_profile_form') {
    //access check
    if (user_access('delete own account') && arg(1) == $user->uid && arg(3)=='') {
      $form['delete'] = array(
        '#type' => 'submit',
        '#value' => t('Delete Account'),
        '#weight' => 31,
        '#submit' => array('user_edit_delete_submit'),
      );
    }
  }

may be the right solution?