Disable an account delete the tags (filters)

Created on 30 September 2013, about 11 years ago
Updated 4 September 2023, about 1 year ago

Hi,

I found that when you BLOCK (disable) a user, the hook_user_cancel() is call, with this method : "user_cancel_block"

In the "privatemsg_filter" module, there is an hook implementation who delete all the tags, whithout checking if the user is deleted, or just blocked.

I recommend to change the hook_user_cancel to this :

/**
/**
 * Implements hook_user_cancel().
 */
function privatemsg_filter_user_cancel($edit, $account, $method) {
  switch ($method) {
    case 'user_cancel_reassign':
    case 'user_cancel_delete':
    // Delete since this is only visible for the user anyway.
    db_delete('pm_tags_index')
      ->condition('uid', $account->uid)
      ->execute();
      break;
  }
}
🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code (privatemsg_filter)

Created by

🇫🇷France kiliweb

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024