From fb03f46ce1e7fe1964c7139e5b1359cdf24aec4b Mon Sep 17 00:00:00 2001 From: damiankloip <damiankloip@1037976.no-reply.drupal.org> Date: Mon, 6 Aug 2012 09:26:47 -0400 Subject: [PATCH] Issue #1547726 by dawehner, damiankloip: Kill implicit relationship from node to node_revision(). --- modules/node.views.inc | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/modules/node.views.inc b/modules/node.views.inc index 2390b298b736..f254f9c3aee5 100644 --- a/modules/node.views.inc +++ b/modules/node.views.inc @@ -32,23 +32,11 @@ function node_views_data() { ); $data['node']['table']['entity type'] = 'node'; - - // For other base tables, explain how we join - $data['node']['table']['join'] = array( - // this explains how the 'node' table (named in the line above) - // links toward the node_revision table. + $data['node']['table']['default_relationship'] = array( 'node_revision' => array( - 'handler' => 'Drupal\views\Join', // this is actually optional - 'left_table' => 'node_revision', // Because this is a direct link it could be left out. - 'left_field' => 'nid', - 'field' => 'nid', - // also supported: - // 'type' => 'INNER', - // 'extra' => array(array('field' => 'fieldname', 'value' => 'value', 'operator' => '=')) - // Unfortunately, you can't specify other tables here, but you can construct - // alternative joins in the handlers that can do that. - // 'table' => 'the actual name of this table in the database', - ), + 'table' => 'node_revision', + 'field' => 'vid', + ), ); // ---------------------------------------------------------------- @@ -450,6 +438,13 @@ function node_views_data() { ), ); + $data['node_revision']['table']['default_relationship'] = array( + 'node' => array( + 'table' => 'node', + 'field' => 'vid', + ), + ); + // uid field for node revision $data['node_revision']['uid'] = array( 'title' => t('User'), -- GitLab