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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

Status: Needs review » Needs work

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

amitaibu’s picture

Status: Needs work » Needs review
FileSize
3.88 KB

Indeed, re-rolled.

amitaibu’s picture

A tab slipped in the patch.

moshe weitzman’s picture

Status: Needs review » Fixed

Committed. Thx.

Status: Fixed » Closed (fixed)

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

Tim_O’s picture

Version: master » 6.x-2.0
Category: feature » bug
Status: Closed (fixed) » 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?

Tim_O’s picture

Assigned: amitaibu » Unassigned

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

Tim_O’s picture

  • moshe weitzman committed 629ef72 on 8.x-1.x
    #338919 by Amitaibu. Rules action - Add group node settings to content