I've been through all the og.module hooks, which contains:
module_invoke_all('og', 'user insert', $gid, $uid, $args);
module_invoke_all('og', 'user update', $gid, $uid, $args);
module_invoke_all('og', 'user delete', $gid, $uid, $args);
module_invoke_all('og', 'user approve', $gid, $uid, $args);
module_invoke_all('og', 'user approve', $node->nid, $account->uid, $message);
module_invoke_all('og', 'user deny', $node->nid, $account->uid, $message);
module_invoke_all('og', 'user request', $gid, $admins, $message);
module_invoke_all('og', 'admin new', $node->nid, $account->uid, $message);
module_invoke_all('og_create_links', $node);
.. it woud seem that the 'user delete' would be the correct hook, however, it seems to be only called when the user deletes self from group, not when the admin does.
if I add:
function mymodule_og($op, $gid, $uid, $args) {
drupal_set_message($op);
drupal_set_message($gid);
drupal_set_message($uid);
}
this works, except as stated: no output when the admin deletes a member, why?
If I add a drupal_set_message to:
function og_delete_subscription($gid, $uid, $args = array()){
drupal_set_message('Deleted!!!!!!!!!!!!!!!!!!!!!!!');
$sql = "DELETE FROM {og_uid} WHERE nid = %d AND uid = %d";
db_query($sql, $gid, $uid);
module_invoke_all('og', 'user delete', $gid, $uid, $args);
}
This also doesn't output when the admin removes a member, so this must be happening from somewhere else, but where?
Comments
Comment #1
Bimble commentedI've gone back to this and the hooks seems to be firing okay. I seem to be a victim of some strange shennigans.
Comment #2
andystox commentedDid you ever find the source of your strange shenanigans? I seem to be having the same problem, I can't seem to get the og hook to fire at all (more info in my original post here http://drupal.org/node/1233644)
Comment #3
andystox commentedNevermind, I was being a tool, I'd used the wrong module name in the hook...