Blocking a user removes all their flags

Created on 28 February 2018, over 7 years ago
Updated 19 August 2025, 6 days ago

Today I recognized that blocking a user (not deleting the user) will remove all their flags. I think this is a critical bug as if the user was blocked accidently and is reactivated later on he should still all their flags in place.
Problem is line 1176 and following:
the hook_user_cancel does not check the cancel method!!

Instead of

function flag_user_cancel($edit, $account, $method) {
  flag_user_account_removal($account);
}

it should be

function flag_user_cancel($edit, $account, $method) {
    if ($method != 'user_cancel_block' && $method != 'user_cancel_block_unpublish') {
        flag_user_account_removal($account);
    }
}
🐛 Bug report
Status

Closed: outdated

Version

3.9

Component

Flag core

Created by

🇩🇪Germany vistree

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