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 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;
#1 og-missing-field-1891308-1.patch558 bytessardara
PASSED: [[SimpleTest]]: [MySQL] 780 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


sardara’s picture

558 bytes
PASSED: [[SimpleTest]]: [MySQL] 780 pass(es). View

Patch attached.

amitaibu’s picture

Status: Active » Needs review

Setting correct status.

kladrian’s picture

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.