Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #381 from Gizra/1865860
Browse files Browse the repository at this point in the history
Issues with multiple entity types as groups
  • Loading branch information
alesrebec authored Jun 20, 2018
2 parents f0139ce + cfee781 commit 983ce45
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion og.module
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,15 @@ function og_field_create_instance($instance) {

$og_field = og_fields_info(OG_AUDIENCE_FIELD);
$og_field['field']['settings']['target_type'] = $entity_type;
$og_field['instance']['label'] = t('Group membership');
if ($entity_type == 'node') {
$og_field['instance']['label'] = t('Group membership');
}
else {
$entity_info = entity_get_info($entity_type);
$og_field['instance']['label'] = t('@label group membership', array(
'@label' => $entity_info['label'],
));
}

// If the user entity type has multiple bundles, make sure to attach a field
// instance to all of them.
Expand Down

0 comments on commit 983ce45

Please sign in to comment.