Closed (fixed)
Project:
Organic Groups
Version:
master
Component:
og.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Aug 2008 at 19:56 UTC
Updated:
22 Jul 2009 at 15:15 UTC
Jump to comment: Most recent file
Comments
Comment #1
moshe weitzman commentedthis should move to the very new og_actions module: og_rules_action_info()
Comment #2
amitaibuYes, file is called
og.rules.incComment #3
fago@patch:
the .rules.inc files are automatically included by rules - so you shouldn't do it.
As an affect, the implementation of og_og() should go into the module itself and use a check module_exists('rules'). The rest should stay in the include file.
@actions module:
hm, I wonder why there is a separate module? It seems that it's the trend to add separate modules for different kind of integration (view, panels, actions,..), but is this really necessary? When the code could also go into a conditionally included file, I see two advantages:
* Users don't have to care about activating just another module to get the integration - it's just there when they use the module (views, panels, rules..).
* One module less cluttering the modules page and at least tiny performance improvements (one module less for hook implementations).
I go this way for rules integrations - but event invocations have to be in the modules. (As rules only includes the include files when rules are configured and get evaluated).
So of course this integration could go into both og or og_actions - as you prefer.
Comment #4
amitaibuMoshe please decide and I will roll the patch accordingly.
Comment #5
moshe weitzman commentedI would like the new actions to go into og_actions module. it sounds like og_og() needs to go into og.module. The rest goes into the include.
Comment #6
fagoOf course we can rename og_og to og_actions_og and move it into the og actions module too. Then the include file should also be og_actions.rules.inc.
Comment #7
amitaibuHow about
og_rules.module? I think it makes more sense as these are the actual modules names.Comment #8
moshe weitzman commentedIf rules module can load the include itself (just like Views2), then thats ideal. Actions does not do that, so it got its own module. OG Views got its own module because O makes such heavy use of embedded Views that it needed its own (optional) module.
Comment #9
amitaibuOk, I'll re-roll.
Comment #10
amitaibuPatch with Rules loading it's own inc files.
Comment #11
fagogreat. patch looks good.
-> wrong comment + * @see og_rules_action_subscribe_user_submit.
-> @og_og: this code needs to be wrapped by a module_exists call - or you get fatal errors without rules.
Furthermore the rules development snapshot has now the upgrade path from workflow-ng included - so let's make sure it works with it.
Comment #12
amitaibuAnother try :)
Comment #13
amitaibuoops, set it RTBC by mistake.
Got some remarks from fago in the IRC, I'll fix them.
Comment #14
moshe weitzman commentedCan we replaced hook_og() with calls to trigger module instead of rules_invoke_event()? Does rules work with triggers automatically?
Comment #15
fagono - it's a replacement for trigger. So it works independent from it.
Comment #16
amitaibumodule_exists() now properly implemented and tested, also removed t() from module name.
Comment #17
amitaibuSome more comments from Fago (thanks for being so patient! :) )
Comment #18
moshe weitzman commentedCommitted. Thx.
A new RC5 release is coming momentarily.
Comment #19
fagothanks for committing moshe.
I've just gave this a test. I tried importing a workflow-ng test config into rules - importing works fine.
However, the trick for loading the event arguments doesn't work any more that way in 6.x. So I changed it to fit to rules (by setting uid, gid to be hidden). Furthermore 'description' was renamed to 'help' and is really only for help - so I also changed this.
So I attach a patch with my changes - it also removes some whitespaces.
After the changes the test-rule works fine.
If you want to test it: I appended the workflow-ng export so you can import it (latest rules module required).
Comment #20
moshe weitzman commentedcommitted. thx.
Comment #21
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #22
juicytoo commentedHi guys,
does this mean that we can now trigger a creation of an OG group using rules?
Thanks in advance.
cheers