Let other modules take advantage of OG Triggers

nschelly - October 29, 2009 - 18:00
Project:Organic groups
Version:6.x-2.0
Component:og.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'd like to design other modules to react to various triggers in OG. In particular, I have a custom module that I want to take some actions when a user requests to join an organic group. The current og_og() function doesn't look for other actions associated with those hooks to react. This patch just finds additional actions to run and runs them. It could also be improved by adding the necessary code to expose these triggers in the admin page for triggers. I'd like to know first if there's interest in this in the module, and if so, I can submit a patch that includes that functionality too.

AttachmentSize
triggers.patch507 bytes

#1

bonobo - October 31, 2009 - 23:05

We'd be interested in this as well --

Items we'd love to see triggers for:

1. Subscription approved
2. Subscription denied
3. User removed from group (by group admin)
4. User unsubscribes themselves from a group

This should probably be a separate module to start: how about OG Triggers as a name?

#2

nschelly - November 1, 2009 - 01:22

It's not so much that it should be another module. The hooks need to be called from in the og codebase and they already are (including at least approve and deny and probably the others). However, the hook_og() function itself isn't calling out for other actions associated with the triggers. My patch just looks for other actions associated with the given trigger and executes them as well.
-N

 
 

Drupal is a registered trademark of Dries Buytaert.