I have tried to setup og_group_ref variable to unlimited, in order to allow posting content to multiple spaces.

Everything works fine, except that it becomes impossible to reply to any discussion. The following error then appears:

OgException: OG membership can not be created in entity <em class="placeholder">node</em> and bundle <em class="placeholder">oa_discussion_post</em> using the field <em class="placeholder">og_group_ref</em> as the field does not reference <em class="placeholder">oa_section</em> bundle in <em class="placeholder">node</em> entity type. in OgMembership->save() (line 62 of /data/all/001/openatrium-7.x-2.19-7.28.1/profiles/openatrium/modules/contrib/og/includes/og.membership.inc).

This would be very useful and I don't see a reason why OA2 should not allow multiple group posting (since OG 2.x this is possible), so I'm adding this as a bug report.

Comments

hefox’s picture

Category: Bug report » Feature request

From what I know of oa (only recently started working on it within the last year), converting to multiple group postings will likely have various problems. Look for anywhere that uses og_group_ref[LANGUAGE_NONE][0]. My guessss is this relates to the logic in oa_discussion_node_update

It looks like the error is saying that the section value doesn't correspond to any of the groups.

mpotter’s picture

Status: Active » Closed (fixed)

There is a field called "Visible in Other Spaces" that is used for cross posting content to different spaces. OA2 architecture assumes og_group_ref just contains a single space value. Content needs a single space and section owner for access control.

hani.atalla’s picture

Mike,

We are doing a migration to Open Atrium 2 from a postgreSQL db using the migrate module. We did the users, spaces, and space membership (OG) - but now we need to create an OA section, "document section in this case", for a given space using the migrate module. In the migrate module to test I am setting the 'og_group_ref' to a default test space '103' and that is the node id for that space using:

$this->destination = new MigrateDestinationNode('oa_section');
// more code here
$this->addFieldMapping('title')->defaultValue('Document Section');
$this->addFieldMapping('body')->defaultValue('Document Section');
$this->addFieldMapping('field_oa_node_types')->defaultValue('oa_wiki_page');
$this->addFieldMapping('field_oa_section_override')->defaultValue('0');
$this->addFieldMapping('uid', 'userid')->sourceMigration(array('LivepersonUsers'));
$this->addFieldMapping('og_group_ref')->defaultValue('103'); 

but when I run the migrate module it throws an ambiguous error and fails to create the node of type oa_section. If I remove the last "FieldMapping" line (where I set it to '103') the migrate module create a node section that is NOT attached to an OA space.

I think I need to send a different value than the space id to og_group_ref but not sure what that is. Not sure.

Appreciate your help.