Fix Views implicit relationship overwriting.

This commit is contained in:
Michael Stenta 2019-08-23 16:56:39 -04:00
parent 1db9cebd02
commit b0d011bd7f
1 changed files with 2 additions and 5 deletions

View File

@ -31,16 +31,13 @@ function farm_plan_views_data_alter(&$data) {
// defined explicitly. If it isn't, then we use the machine name.
$entity_type_table = !empty($info['entity_type_table']) ? $info['entity_type_table'] : $info['entity_type'];
// Create an implicit relationship with the entity type table.
// Create implicit relationships between the plan record table and the plan
// and record entity tables.
$data[$info['table']]['table']['join'] = array(
$entity_type_table => array(
'left_field' => $info['entity_pk'],
'field' => $info['field'],
),
);
// Create an implicit relationship with the {farm_plan} table.
$data[$info['table']]['table']['join'] = array(
'farm_plan' => array(
'left_field' => 'id',
'field' => 'plan_id',