I've started to get this error, when viewing a node I do not have permission to edit:

Warning: Unknown column 'grant_edit' in 'where clause' query: SELECT COUNT(*) FROM node_access WHERE (nid = 0 OR nid = 5) AND ((gid = 0 AND realm = 'all')) AND grant_edit >= 1 in /home/dave/sites/civiclabs/includes/database.mysql.inc on line 120

On some pages this is followed by

Warning: Cannot modify header information - headers already sent by (output started at /home/dave/sites/civiclabs/includes/database.mysql.inc:120) in /home/dave/sites/civiclabs/includes/common.inc on line 266

And in those cases the page I am trying to see does not appear.

Comments

Dave Cohen’s picture

I do not consider this the proper fix. But just in case others have the same trouble and need a temporary workaround:

Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.641.2.3
diff -u -r1.641.2.3 node.module
--- modules/node.module 7 May 2006 17:53:09 -0000       1.641.2.3
+++ modules/node.module 9 May 2006 19:30:33 -0000
@@ -2318,6 +2318,8 @@
     if (count($grants)) {
       $grants_sql = 'AND ('. implode(' OR ', $grants) .')';
     }
+       if ($op == 'edit')
+         $op = 'update'; // d'oh!

     $sql = "SELECT COUNT(*) FROM {node_access} WHERE (nid = 0 OR nid = %d) $grants_sql AND grant_$op >= 1";
     $result = db_query($sql, $node->nid);

Dave Cohen’s picture

Status: Active » Fixed

The problem was with code I wrote and installed locally. So never mind. I was invoking node_access() with an $op of edit when it should have been update. My bad.

Anonymous’s picture

Status: Fixed » Closed (fixed)