I'm trying to invoke hook_user_delete and for some reason it isn't getting called. I have essentially the same function in hook_user_cancel and that gets called correctly. Basically, I go into the user edit form, then down to the bottom to "Cancel Account". From the next page, if I click "Disable the account and keep its content.", the hook_user_cancel function gets called, but if I pick "Delete the account and its content.", neither the hook_user_cancel or the hook_user_delete functions get called. I checked this by placing a dpm at the beginning of each function. My code looks like the following:
function carrier_pigeon_user_delete($account){
$num_deleted = 0;
if(is_numeric($account->uid)) {
$num_deleted = db_delete('carrier_pigeon_subscription')
->condition('uid',account->uid)
->execute();
}
dpm($num_deleted);
}
function carrier_pigeon_user_cancel($edit, $account, $method) {
$num_deleted = 0;
if(is_numeric($account->uid)) {
$num_deleted = db_delete('carrier_pigeon_subscription')
->condition('uid', $account->uid)
->execute();
}
dpm($num_deleted);
}
Sorry about the formatting. Is there something I'm doing wrong here? My impression is that I need both of these to cover my bases, but I can't seem to get the first one to get called.
dpm()
, is there anything else that tells you the hooks are not called?