By andystox on
Hello
I have a pretty straightforward question which so far I've not been able to find a straightforward answer to:
I just need to be able to detect when a user subscribes to an organic group so that I can fire some code on that event*. It looks like the module exposes something to other modules in og_save_subscription (line 714 in og.module):
module_invoke_all('og', 'user update', $gid, $uid, $args);
but I have no idea what that means, and none of my attempts to hook into the event in my custom module have been successful so far (e.g. mymodule_og(..))
*There is an issue with the rules module that prevents me doing this with rules (http://drupal.org/node/1232404)
Comments
Apologies if you've already
Apologies if you've already tried this but a quick peek at the code for module_invoke_all would suggest something like this will work:
Hope that helps
Thanks for the answer but
Thanks for the answer but unfortunately I've tried that already. I thought it might be something to do with the relative module weights so I've tried changing them without any luck, nothing I put in the hook ever seems to fire (I'm just testing it by trying to write a message to the log).
Apologies, this does work, I
Apologies, this does work, I was being an idiot, I changed the module name when testing the weights and forgot to change it back.