Hello!

I'm using node revision argument (Revision: ID) in Page Manager and there are exceptions:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.node_revisions' doesn't exist: SELECT nid FROM {node_revisions} WHERE vid = :vid; Array ( [:vid] => 1874 ) in ctools_argument_rid_context() (line 42 of .../sites/all/modules/ctools/plugins/arguments/rid.inc).

plugins/arguments/rid.inc:42

<?php
$nid
= db_query('SELECT nid FROM {node_revisions} WHERE vid = :vid', array(':vid' => $arg))->fetchField();
?>

should be

<?php
$nid
= db_query('SELECT nid FROM {node_revision} WHERE vid = :vid', array(':vid' => $arg))->fetchField();
?>

Correct table name is node_revision (without s)

Screen shot 2013-06-24 at 12.21.22 PM.png

Files: 
CommentFileSizeAuthor
#2 ctools-node_revision_typo-2026655-2.patch574 bytesAndreyMaximov
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]
#1 ctools-node_revision_typo-2026655-1.patch574 bytesAndreyMaximov
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]
Screen shot 2013-06-24 at 12.21.22 PM.png56.39 KBAndreyMaximov

Comments

Status:Active» Needs review
StatusFileSize
new574 bytes
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

StatusFileSize
new574 bytes
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

Sorry for double postin

Status:Needs review» Reviewed & tested by the community

The simple fix.

Priority:Normal» Critical

This could lead to data-loss

Assigned:Unassigned» merlinofchaos

looks like simple fix
do we need tests here?
if no - RTBC

Please commit before 7.x-1.4.

Issue summary:View changes
Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

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