I have a a content type called network with an entityreference field for the Parent Network that is an OG Audience field (it has the OgBehaviour turned on.) When I build a view of these networks I want to include some fields from the parent network, so I add the relationship "Entity Reference: Referenced Entity: A bridge to the Content entity that is referenced via network_parent"

When I do this I get the following SQL error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node_og_membership__og_membership.network_parent_target_id' in 'on clause'

With the the relevant bit of the query as follows:

LEFT JOIN {node} node_og_membership ON og_membership_party.gid = node_og_membership.nid AND og_membership_party.group_type = 'node'
LEFT JOIN {og_membership} node_og_membership__og_membership ON node_og_membership.nid = node_og_membership__og_membership.etid AND node_og_membership__og_membership.entity_type = 'node'
LEFT JOIN {node} node_og_membership_1 ON node_og_membership__og_membership.network_parent_target_id = node_og_membership_1.nid

Og is joining to the og_membership table (rather than the field_data_network_parent) but is still tyring to join on the network_parent_target_id column.

Solution

There are two options:

  1. Make this relationship join to the field data table.
  2. Make the relationship use the gid field on the membership entity.

Comments

rlmumford’s picture

Priority: Normal » Major
Issue tags: +views integration
dobe’s picture

I believe this is a duplicate of: https://www.drupal.org/node/1890370 reopen if that patch fails.