The code is currently passing the index "author" found in $account->roles during some operations as a gid (which is supposed to be role id) back to node_access() which was causing node_access() to run queries like the one below. The result is some unpredictable access behaviors. I wrote a fix and did a pull request over on irakli's branch https://github.com/inadarei/drupal-workflow
From the conversation over here http://drupal.org/node/558378 it's not exactly clear if it's worth rolling a patch for the current worklow branch on d.o. Any suggestions welcome.
user warning: Unknown column 'author' in 'where clause' query: SELECT COUNT(*) FROM node_access WHERE nid = 0 AND ((gid = 0 AND realm = 'all') OR (gid = 2 AND realm = 'workflow_access') OR (gid = author AND realm = 'workflow_access') OR (gid = 3 AND realm = 'workflow_access_owner')) AND grant_view >= 1 in /home/rj/workspace/***/www/modules/node/node.module on line 2179.
Comments
Comment #1
R.J. Steinert commentedAnd btw... @q0rban, Workflow Access is awesome!! I wish I had known about it a month ago before I wrote Nodeaccess States which accomplishes a similar task but depends on Nodeaccess module to manage the node_access table. Right now it looks like I'm dropping Nodeaccess States for Workflow Access. Looking at the repo history it looks like you whipped this up last October, you gotta mention this module on the Workflow project page, it's so clutch!
Comment #2
brant commentedHey rjstatic-
Wondering if you had any luck tracking the source of this issue down -- I'm getting a similar error at the moment:
Unknown column 'author' in 'where clause' query: SELECT COUNT(*) FROM node_access WHERE nid = 0 AND ((gid = 0 AND realm = 'all') OR (gid = 1 AND realm = 'content_access_author') OR (gid = 2 AND realm = 'content_access_rid') OR (gid = author AND realm = 'content_access_rid') OR (gid = 2 AND realm = 'forum_access') OR (gid = author AND realm = 'forum_access')) AND grant_view >= 1 in /openpublish-2.3/modules/node/node.module on line 2179.
Do you know how author is ending up in the grants table as a gid?
Thanks for any pointers.
-Brant
Comment #3
Bastlynn commentedIn reviewing the code for this then only way I can see it happening is if the $node->uid is somehow set to 'author'. Workflow goes out of the way to explicitly return the uid so that the value is properly numeric. The second sample shows this occurring for realms, 'content_access_rif' and 'forum_access' as well. I'm thinking this is related to something else going on and workflow_access was a bystander.
I could use more information about other modules the two of you may be running that would deal with access permissions.
Comment #4
johnvClosing this issue, since no response for a long time.