diff --git a/og_access/og_access.module b/og_access/og_access.module index d250233..26d9b1f 100644 --- a/og_access/og_access.module +++ b/og_access/og_access.module @@ -239,15 +239,17 @@ function _og_access_verify_access_field_existence($node) { $groups_bundles = og_get_all_group_bundle(); $target_type = $field_info['settings']['target_type']; - foreach (array_keys($groups_bundles[$target_type]) as $bundle) { - $instances = field_info_instances('node', $bundle); - // Verify that the OG access field is attached to the group bundles. - if (empty($instances[OG_ACCESS_FIELD])) { - $params = array( - '@nid' => $node->nid, - '@bundle' => $bundle, - ); - throw new OgException(format_string('Cannot set visibility of node ID @nid as the group node 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('node', $bundle); + // Verify that the OG access field is attached to the group bundles. + if (empty($instances[OG_ACCESS_FIELD])) { + $params = array( + '@nid' => $node->nid, + '@bundle' => $bundle, + ); + throw new OgException(format_string('Cannot set visibility of node ID @nid as the group node of type "@bundle" does not have the "Group visibility" field attached to it.', $params)); + } } } }