From 69e26ce010e2fa4156f1247314e8a0bfc6af48fb Mon Sep 17 00:00:00 2001 From: Daniel Wehner <daniel.wehner@erdfisch.de> Date: Tue, 25 Sep 2012 21:09:00 +0200 Subject: [PATCH] Issue #1794538 by dawehner: Add a node_revision.status field in order to be able to fix the CTools test. --- .../node/Plugin/views/wizard/NodeRevision.php | 2 +- modules/node.views.inc | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/Views/node/Plugin/views/wizard/NodeRevision.php b/lib/Views/node/Plugin/views/wizard/NodeRevision.php index 81d8990a92b9..8e3f3c388681 100644 --- a/lib/Views/node/Plugin/views/wizard/NodeRevision.php +++ b/lib/Views/node/Plugin/views/wizard/NodeRevision.php @@ -65,7 +65,7 @@ class NodeRevision extends WizardPluginBase { protected $filters = array( 'status' => array( 'value' => TRUE, - 'table' => 'node', + 'table' => 'node_revision', 'field' => 'status' ) ); diff --git a/modules/node.views.inc b/modules/node.views.inc index ffddcdb27373..8ac6fd608ccf 100644 --- a/modules/node.views.inc +++ b/modules/node.views.inc @@ -520,6 +520,28 @@ function node_views_data() { ), ); + // published status + $data['node_revision']['status'] = array( + 'title' => t('Published'), + 'help' => t('Whether or not the content is published.'), + 'field' => array( + 'id' => 'boolean', + 'click sortable' => TRUE, + 'output formats' => array( + 'published-notpublished' => array(t('Published'), t('Not published')), + ), + ), + 'filter' => array( + 'id' => 'boolean', + 'label' => t('Published'), + 'type' => 'yes-no', + 'use_equal' => TRUE, // Use status = 1 instead of status <> 0 in WHERE statment + ), + 'sort' => array( + 'id' => 'standard', + ), + ); + // title $data['node_revision']['title'] = array( 'title' => t('Title'), // The item it appears as on the UI, -- GitLab