diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/HistoryUserTimestamp.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/HistoryUserTimestamp.php index 3617bc6..dabf788 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/HistoryUserTimestamp.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/HistoryUserTimestamp.php @@ -30,8 +30,8 @@ public function init(ViewExecutable $view, &$options) { parent::init($view, $options); global $user; if ($user->uid) { - $this->additional_fields['created'] = array('table' => 'node', 'field' => 'created'); - $this->additional_fields['changed'] = array('table' => 'node', 'field' => 'changed'); + $this->additional_fields['created'] = array('table' => 'node_property_data', 'field' => 'created'); + $this->additional_fields['changed'] = array('table' => 'node_property_data', 'field' => 'changed'); if (module_exists('comment') && !empty($this->options['comments'])) { $this->additional_fields['last_comment'] = array('table' => 'node_comment_statistics', 'field' => 'last_comment_timestamp'); } diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php b/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php index af28e1a..e1ece84 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php @@ -54,7 +54,7 @@ class Node extends WizardPluginBase { protected $filters = array( 'status' => array( 'value' => TRUE, - 'table' => 'node', + 'table' => 'node_property_data', 'field' => 'status' ) ); @@ -146,7 +146,7 @@ protected function default_display_options() { // to a row style that uses fields. /* Field: Content: Title */ $display_options['fields']['title']['id'] = 'title'; - $display_options['fields']['title']['table'] = 'node'; + $display_options['fields']['title']['table'] = 'node_property_data'; $display_options['fields']['title']['field'] = 'title'; $display_options['fields']['title']['label'] = ''; $display_options['fields']['title']['alter']['alter_text'] = 0; diff --git a/core/modules/node/node.views.inc b/core/modules/node/node.views.inc index bf30614..cb4b9a0 100644 --- a/core/modules/node/node.views.inc +++ b/core/modules/node/node.views.inc @@ -31,6 +31,14 @@ function node_views_data() { ); $data['node']['table']['entity type'] = 'node'; + $data['node_property_data']['table']['group'] = t('Content'); + $data['node_property_data']['table']['entity type'] = 'node'; + $data['node_property_data']['table']['join']['node'] = array( + 'type' => 'INNER', + 'left_field' => 'nid', + 'field' => 'nid', + ); + // node table -- fields // nid @@ -61,7 +69,7 @@ function node_views_data() { // title // This definition has more items in it than it needs to as an example. - $data['node']['title'] = array( + $data['node_property_data']['title'] = array( 'title' => t('Title'), // The item it appears as on the UI, 'help' => t('The content title.'), // The help that appears on the UI, // Information for displaying a title as a field @@ -85,7 +93,7 @@ function node_views_data() { ); // created field - $data['node']['created'] = array( + $data['node_property_data']['created'] = array( 'title' => t('Post date'), // The item it appears as on the UI, 'help' => t('The date the content was posted.'), // The help that appears on the UI, 'field' => array( @@ -101,7 +109,7 @@ function node_views_data() { ); // changed field - $data['node']['changed'] = array( + $data['node_property_data']['changed'] = array( 'title' => t('Updated date'), // The item it appears as on the UI, 'help' => t('The date the content was last updated.'), // The help that appears on the UI, 'field' => array( @@ -135,8 +143,29 @@ function node_views_data() { ), ); + // Language field + if (module_exists('language')) { + $data['node']['langcode'] = array( + 'title' => t('Language'), + 'help' => t('The language the content is in.'), + 'field' => array( + 'id' => 'node_language', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'id' => 'language', + ), + 'argument' => array( + 'id' => 'language', + ), + 'sort' => array( + 'id' => 'standard', + ), + ); + } + // published status - $data['node']['status'] = array( + $data['node_property_data']['status'] = array( 'title' => t('Published'), 'help' => t('Whether or not the content is published.'), 'field' => array( @@ -158,7 +187,7 @@ function node_views_data() { ); // published status + extra - $data['node']['status_extra'] = array( + $data['node_property_data']['status_extra'] = array( 'title' => t('Published or admin'), 'help' => t('Filters out unpublished content if the current user cannot view it.'), 'filter' => array( @@ -169,7 +198,7 @@ function node_views_data() { ); // promote status - $data['node']['promote'] = array( + $data['node_property_data']['promote'] = array( 'title' => t('Promoted to front page'), 'help' => t('Whether or not the content is promoted to the front page.'), 'field' => array( @@ -190,7 +219,7 @@ function node_views_data() { ); // sticky - $data['node']['sticky'] = array( + $data['node_property_data']['sticky'] = array( 'title' => t('Sticky'), // The item it appears as on the UI, 'help' => t('Whether or not the content is sticky.'), // The help that appears on the UI, // Information for displaying a title as a field @@ -212,27 +241,6 @@ function node_views_data() { ), ); - // Language field - if (module_exists('language')) { - $data['node']['langcode'] = array( - 'title' => t('Language'), - 'help' => t('The language the content is in.'), - 'field' => array( - 'id' => 'node_language', - 'click sortable' => TRUE, - ), - 'filter' => array( - 'id' => 'language', - ), - 'argument' => array( - 'id' => 'language', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); - } - // Define some fields based upon views_handler_field_entity in the entity // table so they can be re-used with other query backends. // @see views_handler_field_entity @@ -273,7 +281,7 @@ function node_views_data() { // Bogus fields for aliasing purposes. - $data['node']['created_fulldate'] = array( + $data['node_property_data']['created_fulldate'] = array( 'title' => t('Created date'), 'help' => t('Date in the form of CCYYMMDD.'), 'argument' => array( @@ -282,7 +290,7 @@ function node_views_data() { ), ); - $data['node']['created_year_month'] = array( + $data['node_property_data']['created_year_month'] = array( 'title' => t('Created year + month'), 'help' => t('Date in the form of YYYYMM.'), 'argument' => array( @@ -291,7 +299,7 @@ function node_views_data() { ), ); - $data['node']['created_year'] = array( + $data['node_property_data']['created_year'] = array( 'title' => t('Created year'), 'help' => t('Date in the form of YYYY.'), 'argument' => array( @@ -300,7 +308,7 @@ function node_views_data() { ), ); - $data['node']['created_month'] = array( + $data['node_property_data']['created_month'] = array( 'title' => t('Created month'), 'help' => t('Date in the form of MM (01 - 12).'), 'argument' => array( @@ -309,7 +317,7 @@ function node_views_data() { ), ); - $data['node']['created_day'] = array( + $data['node_property_data']['created_day'] = array( 'title' => t('Created day'), 'help' => t('Date in the form of DD (01 - 31).'), 'argument' => array( @@ -318,7 +326,7 @@ function node_views_data() { ), ); - $data['node']['created_week'] = array( + $data['node_property_data']['created_week'] = array( 'title' => t('Created week'), 'help' => t('Date in the form of WW (01 - 53).'), 'argument' => array( @@ -327,7 +335,7 @@ function node_views_data() { ), ); - $data['node']['changed_fulldate'] = array( + $data['node_property_data']['changed_fulldate'] = array( 'title' => t('Updated date'), 'help' => t('Date in the form of CCYYMMDD.'), 'argument' => array( @@ -336,7 +344,7 @@ function node_views_data() { ), ); - $data['node']['changed_year_month'] = array( + $data['node_property_data']['changed_year_month'] = array( 'title' => t('Updated year + month'), 'help' => t('Date in the form of YYYYMM.'), 'argument' => array( @@ -345,7 +353,7 @@ function node_views_data() { ), ); - $data['node']['changed_year'] = array( + $data['node_property_data']['changed_year'] = array( 'title' => t('Updated year'), 'help' => t('Date in the form of YYYY.'), 'argument' => array( @@ -354,7 +362,7 @@ function node_views_data() { ), ); - $data['node']['changed_month'] = array( + $data['node_property_data']['changed_month'] = array( 'title' => t('Updated month'), 'help' => t('Date in the form of MM (01 - 12).'), 'argument' => array( @@ -363,7 +371,7 @@ function node_views_data() { ), ); - $data['node']['changed_day'] = array( + $data['node_property_data']['changed_day'] = array( 'title' => t('Updated day'), 'help' => t('Date in the form of DD (01 - 31).'), 'argument' => array( @@ -372,7 +380,7 @@ function node_views_data() { ), ); - $data['node']['changed_week'] = array( + $data['node_property_data']['changed_week'] = array( 'title' => t('Updated week'), 'help' => t('Date in the form of WW (01 - 53).'), 'argument' => array( @@ -382,7 +390,7 @@ function node_views_data() { ); // uid field - $data['node']['uid'] = array( + $data['node_property_data']['uid'] = array( 'title' => t('Author uid'), 'help' => t('The user authoring the content. If you need more fields than the uid add the content: author relationship'), 'relationship' => array(