Problem/Motivation

I have two group content types, post and image, that belong to a group.
In the group page, I show both the post and image forms with blocks.
Only the first form shows the group audience field.

Proposed resolution

I've tracked down the issue to the og.field.inc file, line #45

  $identifier = $field_name . ':' . $entity_type . ':' . $id;
  if (isset($cache[$identifier])) {
    return array();
  }

The identifier is something like og_group_ref:node: for create forms, but it's missing the bundle property so renders after the first one just skip the field.
Adding the bundle, available a few lines above (#42), solves the problem.

  $identifier = $field_name . ':' . $entity_type . ':' . $bundle . ':' . $id;
CommentFileSizeAuthor
#1 og-missing-field-1891308-1.patch558 bytessardara
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sardara’s picture

Patch attached.

amitaibu’s picture

Status: Active » Needs review

Setting correct status.

kladrian’s picture

Hi,
I have the same issue:
3 content types set as group content, all forms rendered in one page and the Group audience field is rendere only once.

Applying the patch solve the problem.

Thanks sardara!

amitaibu’s picture

Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

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