Just a heads up... This module won't work when the Protect Critical Users module is installed. The specific conflict is hook_form_alter.

 * Implementation of hook_form_alter().
function protect_critical_users_form_alter(&$form, $form_state, $form_id) {
  global $user;

  // Remove delete button from user 1 edit form.
  if ($form_id == 'user_profile_form' && isset($form['delete']) && isset($form['_account']['#value']->uid)) {
    if ($form['_account']['#value']->uid == 1 || $form['_account']['#value']->uid == $user->uid) {

As you can see... Protect Critical Users unsets the delete button. Also might I suggest the thought of merging these modules? I'm not saying they do the same task. but the idea of users who can delete their own account while still protecting certain roles of super admin from doing so to their account.

Members fund testing for the Drupal project. Drupal Association Learn more


sanduhrs’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Category: bug » feature
Priority: Critical » Normal

I will have a look at that.

mrfelton’s picture

perhaps the critical_users module should not be unsetting the delete button, but instead setting $form['delete']['#access'] = FALSE;

sanduhrs’s picture

Project: User Delete » Protect Critical Users
Version: 6.x-1.x-dev » 6.x-1.1

That actually feels more like a issue for protect_critical_users module.

markus_petrux’s picture

Project: Protect Critical Users » User Delete
Version: 6.x-1.1 » 6.x-1.x-dev

The life time of the Protect Critical Users (PCU) module is quite short, and it will end as soon as the core issue is fixed: #46149: Prevent account cancellation for uid 1. I do not plan to extend the module with anything else. It will simply die the day core is fixed.

So... I would suggest adding to User Delete whatever it may need to make PCU redundant.

As far as PCU is concerned, this is "won't fix" / "by design". Both modules are simply not compatible. If users need User Delete, then I would suggest asking UD for anything it may need to cover the whole picture. User Delete module will need it from D7 and on, because the core patch is about to get in pretty soon, it seems to me.

sanduhrs’s picture

Status: Active » Closed (works as designed)

user_delete module will not have a D7 release either as the functinality it provides is included in D7.

manuel.adan’s picture

This may help both module to be used with no conflict. Note that patch is for the protect_critical_users module 6.x-1.1