after enabling the module i get the following error message:
user warning: Table 'XXX.nodeaccess' doesn't exist query: SELECT nid, gid, realm, grant_view, grant_update, grant_delete FROM nodeaccess where nid = 1 in /var/www/vhosts/XXX/httpdocs/online/includes/database.mysql.inc on line 172.
The table creation commands seem to be only executed when performing an "update".
Comments
Comment #1
lorr commentedAfter executing the mysql create table query manually nodeaccess seems to work really fine.
Comment #2
Anonymous (not verified) commentedYou need to run update.php to properly set everything up, as indicated in the README file. I haven't found a way around this, other than to run the code on both installation and updating which I suppose is an option although it doesn't seem like a good thing to do...
Comment #3
Dan DG commentedI'm having a similar issue on a clean Drupal 5.1 install.
After enable the module I get the same error as lorr, I then run update.php which tells me no updates available, then says 'updates were attempted' and shows no failures.
I then return to my admin pages and am greeted with:
user warning: Table 'xxx.node_access' doesn't exist query: SELECT COUNT(*) FROM node_access WHERE nid = 0 AND ((gid = 0 AND realm = 'all') OR (gid = 2 AND realm = 'nodeaccess_rid') OR (gid = 4 AND realm = 'nodeaccess_rid') OR (gid = 5 AND realm = 'nodeaccess_rid') OR (gid = 6 AND realm = 'nodeaccess_rid') OR (gid = 7 AND realm = 'nodeaccess_rid') OR (gid = 1 AND realm = 'nodeaccess_uid')) AND grant_view >= 1 in /xxx/includes/database.mysql.inc on line 172.I'm pretty much a complete newbie when it comes to phpMyAdmin/MySQL, but I can see that there's now a table called 'nodeaccess' (without the underscore that is present in the error message) but that it is empty (at least, it has zero rows, does that qualify as empty?!).
Presumably there's a way to manually create the required db structure? Is there a way I can find out what structure I need so I can then try and play around figuring out how to create it? I have back ups of my database at various stages, in anticipation of me managing to destroy something along the way! Wish me luck!
I'm determined to get this working on my site, as this looks like a great module and very useful. :)
Comment #4
Anonymous (not verified) commentedIf you run update.php, you can manually select update 1 for the nodeaccess.module to make it rerun.
However, your db query error I can't really answer... There is no query that has a SELECT COUNT(*) in this module, so I can't say for sure where it's coming from. As far as the table node_access not existing, that's a core table installed by drupal and not this module. Actually that query seems to be coming from node.module, the core drupal node module. I'd check and see if you have a node_access table, and if not, there's your answer. If you don't have one, you might want to reinstall drupal or rerun the database setup for drupal.
Comment #5
Dan DG commentedI was beginning to suspect that was the case with the table node_access, but I I'd been staring at it all for so long that I was starting to go in circles! Thanks for confirming where the problem there lies, and also for explaining for me about manually selecting update one.
Thanks for taking the time to answer my post, it's much appreciated!
Comment #6
Anonymous (not verified) commented