diff --git a/og_access/og_access.module b/og_access/og_access.module index ab8f10e..7e1ff4c 100644 --- a/og_access/og_access.module +++ b/og_access/og_access.module @@ -242,16 +242,18 @@ function _og_access_verify_access_field_existence($node) { $field_info = field_info_field($field_name); $target_type = $field_info['settings']['target_type']; - foreach (array_keys($groups_bundles[$target_type]) as $bundle) { - $instances = field_info_instances($target_type, $bundle); - // Verify that the OG access field is attached to the group bundles. - if (empty($instances[OG_ACCESS_FIELD])) { - $params = array( - '!nid' => $node->nid, - '%entity_type' => $target_type, - '%bundle' => $bundle, - ); - throw new OgException(format_string('Cannot set visibility of node ID !nid as the %entity_type group of type %bundle does not have the "Group visibility" field attached to it.', $params)); + if ($target_type == 'node') { + foreach (array_keys($groups_bundles[$target_type]) as $bundle) { + $instances = field_info_instances($target_type, $bundle); + // Verify that the OG access field is attached to the group bundles. + if (empty($instances[OG_ACCESS_FIELD])) { + $params = array( + '!nid' => $node->nid, + '%entity_type' => $target_type, + '%bundle' => $bundle, + ); + throw new OgException(format_string('Cannot set visibility of node ID !nid as the %entity_type group of type %bundle does not have the "Group visibility" field attached to it.', $params)); + } } } }