Download & Extend

Let other modules take advantage of OG Triggers

Project:Organic groups
Version:6.x-2.x-dev
Component:og.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
triggers.patch507 bytesIgnored: Check issue status.NoneNone

Comments

#1

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

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

#3

Status:active» needs review

#4

Status:needs review» postponed (maintainer needs more info)

Isn't it something you can already achieve with the Rules integration? I'm not an actions fan, and think Rules provides a superior solution.

#5

Rules brings a lot of additional code into the mix. While it might be a good solution for some use cases, in many situations, it will be overkill.

Given that actions are in core, a lighter-weight approach could be useful.

#6

In this case, OG already has triggers setup for certain events in OG. It just doesn't allow users to attach their own actions to those triggers. It's a simple enough addition to make it check for other modules' actions to call without involving rules at all.

If that's not sufficient explanation, what can I do to fulfill the "maintainer needs more info" status?
-N

#7

Status:postponed (maintainer needs more info)» needs review

I understand - thanks for the explanation, setting back to needs review -- I'll appreciate if someone using triggers/ actions can review and set to RTBC.

#8

subscribing

#9

Subscribing. I think a very common use case for this feature would be emailing the manager of a group when group membership is requested. I can't think of a single "og" client site where that wouldn't be appreciated.

#10

Version:6.x-2.0» 6.x-2.x-dev

Someone, that is not necessarily me, will need to test, review and RTBC this patch, if we want it in...

#11

@nschelly - could you please re-roll this patch off DRUPAL-6--2 with cvs diff -up. I'd like to try it out?

#12

Status:needs review» fixed

It appears to be in as of three months ago (in the DRUPAL-6--2 branch), checked in by you on behalf of Scott Reynolds in slightly modified form (look for the og_og function). So I think this is all set.

#13

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here