Question

I have Organic Groups installed on my Drupal website. I created groups and a group content type. In the group content type I have an OG Reference field to refer to the group it can belong. However, this field also automatically shows a "Other groups" field. How can I remove this "Other groups" field, as I do not want to enable users to choose other groups to fill in.

Thanks!

Was it helpful?

Solution 2

The "Other groups" field is only visible to users with "Administer Group" permissions. This permission is under:

/drupal/admin/config/group/permissions/node/%node%

I wouldn't worry about this since regular users won't see this but if you want this removed you can remove this field for ALL users by removing ALL roles from Administer Group permissions. Just unselect the option in the above mentioned URL.

OTHER TIPS

You can hide it by using hook_field_widget_form_alter():

/**
 * Implements hook_field_widget_form_alter().
 */
function fr_groups_field_widget_form_alter(&$element, &$form_state, $context) {
  // Hide "Other groups" table for group selection.
  if ($element['#field_name'] == 'og_group_ref' && isset($element['admin'])) {
    $element['admin']['#access'] = FALSE;
  }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top