Current version:
; Information added by drupal.org packaging script on 2007-12-08
version = "5.x-1.x-dev"
project = "revision_moderation"
datestamp = "1197072612"
Tried on the version from 2008/02/02, but the problem still exists.

1. Create a view
2. Create a filter with Node revision: State.
3. Choose "Under moderation" and "Current"
4. Save and test it.

In my case (Drupal 5.6) I have this error:

* warning: Invalid argument supplied for foreach() in /home/apps/hitra/trunk/www/sites/all/modules/contributions/revision_moderation/revision_moderation_views.inc on line 137.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') /* not cached */' at line 1 query: SELECT count( DISTINCT(node.nid)) FROM node node LEFT JOIN node_revisions node_revisions ON node.nid = node_revisions.nid WHERE (node.type IN ('training')) AND (node.uid = '2') AND () in /home/apps/hitra/trunk/www/includes/database.mysqli.inc on line 155.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY node_changed DESC LIMIT 0, 30 /* not cached */' at line 1 query: SELECT DISTINCT(node.nid), node.title AS node_title, node.changed AS node_changed, node.type AS node_type, node.uid AS node_uid, node.created AS node_created, node.vid AS node_vid, node_revisions.vid AS node_revisions_vid FROM node node LEFT JOIN node_revisions node_revisions ON node.nid = node_revisions.nid WHERE (node.type IN ('training')) AND (node.uid = '2') AND () ORDER BY node_changed DESC LIMIT 0, 30 in /home/apps/hitra/trunk/www/includes/database.mysqli.inc on line 155.

Ironically, when I expose this filter, I can select "Under moderation" and "Current" and it works.

-------
Bernard Szlachta
http://www.nobleprog.co.uk/drupal/training
http://www.nobleprog.us/drupal-training-courses

Comments

toemaz’s picture

Status: Active » Needs review
StatusFileSize
new804 bytes

Hi,

Can you try to apply the attached patch?
Make sure you clear the cache after applying it, so the view is being recreated.

If you don't know how to apply patches, simply follow these instructions:
Go to line 124 in the revision_moderation_views.inc file and take away the double slashes so you end up with
'value-type' => 'array',

Provide feedback if you can.

[Update: I should not forget to mention that this patch is the same as provided in http://drupal.org/node/118666#comment-691922 but it is better we continue in this issue.]

Leeteq’s picture

Subscribing.

hillaryneaf’s picture

I tried the patch but nothing shows up in the view and I get this error when I look at the view:

user warning: Unknown column 'node_revisions.vid' in 'where clause' query: SELECT count(node.nid) FROM node node WHERE (node_revisions.vid > node.vid) in C:\server\Apache2.2\htdocs\drupal\includes\database.mysql.inc on line 172.

user warning: Unknown column 'node_revisions.vid' in 'where clause' query: SELECT node.nid, node.title AS node_title, node.changed AS node_changed FROM node node WHERE (node_revisions.vid > node.vid) LIMIT 0, 6 in C:\server\Apache2.2\htdocs\drupal\includes\database.mysql.inc on line 172.

The revisions can be seen in the Pending Revisions page when viewing list of content though...

alxbridge’s picture

StatusFileSize
new901 bytes

The errors above were occurring because the view query wasn't ensuring a join to the node_revisions table. Updated patch attached.

toemaz’s picture

Status: Needs review » Reviewed & tested by the community

Tested and RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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

jenlampton’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Category: bug » support
Status: Closed (fixed) » Active

Though Node revision is now a type of available view in Views 2.x I still can't find a way to filter my view into a list of only nodes that actually have revisions.

(Maybe a relationship is necessary between nodes and their revisions so we can compare node created time / revision created time to see if a revision exists...?)

I'm out of ideas here.

Suggestions?

Jen

toemaz’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev
Category: support » bug
Status: Active » Closed (fixed)

@jenlampton
It's advised not to reopen an old issue, especially when it has no or little relationship, or when it is in another category or tied to another Drupal version. Instead, create a new one.