Not exactly a bug, but something that worths a warning. The following code in og_ui_field_formatter_view method could be very slow if you have a large # of group nodes in the audience field:

        // Multi-value field.
        foreach ($wrapper->{$field_name} as $wrapper_field) {
          $id = $wrapper_field->value(array('identifier' => TRUE));
          if ($wrapper_field->entityAccess('view')) {
            $accessible_ids[$id] = TRUE;
          }
          else {
            $private = TRUE;
          }
        }

This is because $wrapper_field->entityAccess is calling node_access if your group is a node, and node_access a costly function to call, not something you want to do if there're thousands of nodes.

Comments

amitaibu’s picture

Status: Active » Postponed (maintainer needs more info)

What's your suggestion - not to check access?

jrao’s picture

Not really, I'm just posting it here so that people would be aware of this potential performance issue, since it took me a while to find it. I'm not sure anything should be changed in code, although I vaguely remember query alteration can be used to check access, which is used by views.