Rules action - Add group node settings to content

Amitaibu - November 25, 2008 - 14:43
Project:Organic groups
Version:6.x-2.0
Component:og.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:rules integration
Description

This allows to create a rule that will 'Add new content' and then make this new content a group.

* I had to do some tweaking to og_group_form() in order to use it in the rules settings.
* I haven't been able for some reason, to incorporate the token integration for the 'description' field, but IMO this can come as a follow-up patch.

AttachmentSize
og_rules_create_group_node_1.patch5.6 KB
Screenshot.png38.23 KB

#1

moshe weitzman - November 28, 2008 - 19:25
Status:needs review» needs work

The og.module changes look odd. When would $node->type be empty?

#2

Amitaibu - November 29, 2008 - 10:53
Status:needs work» needs review

Indeed, re-rolled.

AttachmentSize
338919_2_og_rules_create_group_node.patch 3.88 KB

#3

Amitaibu - December 31, 2008 - 14:42

A tab slipped in the patch.

AttachmentSize
338919_3_og_rules_create_group_node.patch 3.89 KB

#4

moshe weitzman - January 2, 2009 - 03:58
Status:needs review» fixed

Committed. Thx.

#5

System Message - January 16, 2009 - 04:00
Status:fixed» closed

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

#6

Tim_O - November 9, 2009 - 23:30
Version:HEAD» 6.x-2.0
Category:feature request» bug report
Status:closed» active

This is cool, but I do not have the option to set the group private. Is this possibly missing in the code from og.rules.inc:

152 /**
153 * Action:Add group node settings to content.
154 */
155 function og_rules_action_add_group_node($node, $settings) {
156   if (og_is_group_type($node->type)) {
157     // Add og keys to the node.
158     foreach ($settings['og_fieldset']['og_settings'] as $key => $value){
159       $node->$key = $value;
160     }
161     return array('node' => $node);
162   }
163 }

Or is the private checkbox included in this and something else is going wrong?

#7

Tim_O - November 13, 2009 - 16:53
Assigned to:Amitaibu» Anonymous

Just noticed this was assigned from the creation, sry for not resetting that when writing the bug report.

#8

Tim_O - November 13, 2009 - 16:58
 
 

Drupal is a registered trademark of Dries Buytaert.