I'm not sure if this is an issue with Rules or Organic Groups, however...
I am trying to set up a rule so that when a particular content type is posted the first time, it is assigned to a specific group. After that, the group can be changed.
1) I create a rule for the action "After saving new content"
2) I add a condition that checks that to see if the content type is "test"
3) If that matches, I "Add content to specified group" for the "private" Organic Group
When I create the specified content, the debug output says that the rule is evaluate, the condition is true, and that the content type is changed. However, when you check the new post, the Group is not modified at all.
If I run this on the action "Content is going to be saved", it works, but then it is posted to the Group no matter what; even if I uncheck the "private" Group box, the rule (correctly) adds it back to the "private" Group.
Now, if I set up a Drupal Advanced Action for "Add post to the specified group...", and then assign that Action to a Trigger for "After saving a new post", new posts are correctly added to the "private" Group, and only when they are first created. The obvious drawback is that this applies to all content types, not just the one I want to this to work with.
On the thought that the content was being saved before the group change was being applied, I also added the "Save Content" action to my rule, however that still does not work.
Am I misunderstanding something in the way this is supposed to work? Is this a problem with the Rules module? Or with the OG integration?
Comments
Comment #1
iris_passcal commentedI've wrestled with this for two weeks, and within 1/2 day of posting a question about it, I've found the problem.
I looked through OG's CVS messages again and found a patch committed to HEAD on September 24th, 2008 that fixes bug #312986: Make og_add_group_action VBO-friendly. The nature of this bug causes this to work when using Triggers, but not via another program.
Sorry for wasting your time!