I have Views and am trying to get a list of all pending revisions.

I have added the filter "Current revision: State (= Pending)" and I do see the pending revision item in my system that has NEVER been published/approved. However, what I DO NOT see is any node that has a pending revision that has EVER been published in the past. In other words, if I create a node and it requires moderation and is not published, it shows up in the list. But, if I edit a current node, the pending revision that has not yet been published, does not show up in the list.

How do I get a list/result set of all nodes with a pending revision that has not yet been published but also has a currently published earlier revision?

Comments

rdeboer’s picture

Hmmm.... strange.

It should work exactly as you say....
Are you logged in as admin?

The alternative is to use the "Pending revisions" block (which is not a view). Try that and see how they compare.

rdeboer’s picture

Status: Active » Closed (cannot reproduce)
highfellow’s picture

Status: Closed (cannot reproduce) » Reviewed & tested by the community

I seem to be having the same problem. I have made a view to show pending revisions, using an unformatted list of 'Content Revision: Title' fields. I am filtering on 'Content Revision: State = Pending'. It shows newly submitted content OK, but not new revisions of existing content. I've done my best to copy the view settings from #1309100: "Pending revisions" block requires a published current revision before it shows pending revisions.

I can't use the 'pending revisions' block, because I also want to filter on the value of a 'ready for publication' field I've added to the content types. I only want to show the items which are awaiting moderation and have this box ticked.

highfellow’s picture

Status: Reviewed & tested by the community » Active

Sorry should probably have set the status to active.

highfellow’s picture

Here is an export of the view I am using:

$view = new view();
$view->name = 'pending_revisions';
$view->description = 'List of pending revisions to go in the dashboard';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Pending revisions';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Pending revisions';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Content revision: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node_revision';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['link_to_node_revision'] = TRUE;
/* Sort criterion: Content revision: Updated date */
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['table'] = 'node_revision';
$handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
/* Filter criterion: Content revision: State */
$handler->display->display_options['filters']['state']['id'] = 'state';
$handler->display->display_options['filters']['state']['table'] = 'node_revision';
$handler->display->display_options['filters']['state']['field'] = 'state';
$handler->display->display_options['filters']['state']['value'] = array(
  2 => '2',
);
$handler->display->display_options['filters']['state']['expose']['operator_id'] = 'state_op';
$handler->display->display_options['filters']['state']['expose']['label'] = 'State';
$handler->display->display_options['filters']['state']['expose']['operator'] = 'state_op';
$handler->display->display_options['filters']['state']['expose']['identifier'] = 'state';
$handler->display->display_options['filters']['state']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  5 => 0,
  4 => 0,
  3 => 0,
);

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'view/pending-revisions';
highfellow’s picture

I've had a quick look at the code in the module; in particular views/revisioning_handler_filter_revision_state.inc . I can't see any obvious problems with the way the filter is defined, and I'm not sure where to go from here to debug this issue. I am willing to post debug information here, but could do with some help from someone who knows this module well.

rdeboer’s picture

Version: 7.x-1.3 » 7.x-1.5
Assigned: Unassigned » rdeboer
Status: Active » Fixed

Duplicate of #2070819: Views 'Content revision: State' gives wrong results for Pending state.

There is now a canned View to produce a list of individual revisions, filtered by state (Archived, Pending, Current/Published).
You can use this View as a base for your own customisations.

Rik

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.