diff --git a/modules/node.views.inc b/modules/node.views.inc index ebba3d3..71a1023 100644 --- a/modules/node.views.inc +++ b/modules/node.views.inc @@ -439,7 +439,7 @@ function node_views_data() { $data['node_revision']['table']['default_relationship'] = array( 'node' => array( 'table' => 'node', - 'field' => 'vid', + 'field' => 'nid', ), ); @@ -456,24 +456,57 @@ function node_views_data() { ); // nid + $data['node_revision']['nid'] = array( + 'title' => t('Nid'), + // The help that appears on the UI. + 'help' => t('The revision NID of the content revision.'), + // Information for displaying the nid. + 'field' => array( + 'click sortable' => TRUE, + ), + // Information for accepting a nid as an argument. + 'argument' => array( + 'handler' => 'views_handler_argument_node_nid', + 'click sortable' => TRUE, + 'numeric' => TRUE, + ), + // Information for accepting a nid as a filter. + 'filter' => array( + 'handler' => 'views_handler_filter_numeric', + ), + // Information for sorting on a nid. + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + 'relationship' => array( + 'handler' => 'views_handler_relationship', + 'base' => 'node', + 'base field' => 'nid', + 'title' => t('Content'), + 'label' => t('Get the actual content from a content revision.'), + ), + ); + + // vid $data['node_revision']['vid'] = array( 'title' => t('Vid'), - 'help' => t('The revision ID of the content revision.'), // The help that appears on the UI, - // Information for displaying the nid + // The help that appears on the UI. + 'help' => t('The revision ID of the content revision.'), + // Information for displaying the vid. 'field' => array( 'click sortable' => TRUE, ), - // Information for accepting a nid as an argument + // Information for accepting a vid as an argument. 'argument' => array( 'handler' => 'views_handler_argument_node_vid', 'click sortable' => TRUE, 'numeric' => TRUE, ), - // Information for accepting a nid as a filter + // Information for accepting a vid as a filter. 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), - // Information for sorting on a nid. + // Information for sorting on a vid. 'sort' => array( 'handler' => 'views_handler_sort', ),