diff --git a/og_access/og_access.module b/og_access/og_access.module index d250233..bdeccdd 100644 --- a/og_access/og_access.module +++ b/og_access/og_access.module @@ -240,14 +240,14 @@ function _og_access_verify_access_field_existence($node) { $target_type = $field_info['settings']['target_type']; foreach (array_keys($groups_bundles[$target_type]) as $bundle) { - $instances = field_info_instances('node', $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, '@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)); + throw new OgException(format_string('Cannot set visibility of node ID @nid as the group of type "@bundle" does not have the "Group visibility" field attached to it.', $params)); } } }