Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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;
Comment | File | Size | Author |
---|---|---|---|
#1 | og-missing-field-1891308-1.patch | 558 bytes | sardara |
Comments
Comment #1
sardara CreditAttribution: sardara commentedPatch attached.
Comment #2
amitaibuSetting correct status.
Comment #3
kladrian CreditAttribution: kladrian commentedHi,
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!
Comment #4
amitaibuCommitted, thanks.