Jump to:
| Project: | Nodeaccess |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
Hi,
after disabling and uninstalling the "Nodeaccess" module, the "nodeaccess" and "nodeaccess_role_alias" tables (are there any more used by this module?) tables still exist in the database. However, the module outputted no error messages during uninstall, and the tables were empty.
I manually did a DROP TABLE `nodeaccess`, `nodeaccess_role_alias`; to clean up the mess; new nodes that are supposed to be "published" and "promoted to the front page" are still invisible to anonymous users, and I can't make them visible again.
Additionally, I can't find these nodes in the "node_access" table (belonging to node.module from Drupal Core), e.g. with SELECT * FROM `node_access` WHERE `nid` = 30432 where "30432" is the nid of a newly created node; shouldn't a record for new nodes appear in this table with something like "grant_view = 1"? Does the "Nodeaccess" some modification to this table from core, even after uninstalling the module and deleting the files from /sites/all/modules??
Thanks for any help & greetings, -asb
PS: This might be related to this crital issue.
Comments
#1
subscribing
#2
Had the same problem, can be fixed by rebuilding node permissions, see:
http://drupal.org/node/122476
#3
...but only if it finishes. On larger sites, it usually doesn't.
Edit: ... or it dies for other reasons, like so:
Fatal error: Allowed memory size of 157286400 bytes exhausted (tried to allocate 82 bytes) in /var/www/drupal/includes/module.inc on line 87That site has some 50k nodes and already runs with an PHP memory_limit set to 150M; increasing this in steps from 256M, 512M, 1024M and even 2048M doesn't help (the server has 4 GB of RAM).
Greetings, -asb
#4
Hi,
since this critical issue is still unsolved after almost one year, here's a quick update.
The "Nodeaccess" module seems to create a new table to manage it's node access permissions:
mysql> describe node_access;+--------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| nid | int(10) unsigned | NO | PRI | 0 | |
| gid | int(10) unsigned | NO | PRI | 0 | |
| realm | varchar(255) | NO | PRI | | |
| grant_view | tinyint(1) unsigned | NO | | 0 | |
| grant_update | tinyint(1) unsigned | NO | | 0 | |
| grant_delete | tinyint(1) unsigned | NO | | 0 | |
+--------------+---------------------+------+-----+---------+-------+
6 rows in set (0.00 sec)
The contents of this table looks like this (for example):
mysql> select * from node_access where nid=100;+-----+-----+-------------------+------------+--------------+--------------+
| nid | gid | realm | grant_view | grant_update | grant_delete |
+-----+-----+-------------------+------------+--------------+--------------+
| 100 | 1 | nodeaccess_rid | 1 | 0 | 0 |
| 100 | 2 | nodeaccess_author | 1 | 1 | 1 |
| 100 | 2 | nodeaccess_rid | 1 | 0 | 0 |
| 100 | 3 | nodeaccess_rid | 1 | 0 | 0 |
| 100 | 4 | nodeaccess_rid | 1 | 1 | 1 |
| 100 | 5 | nodeaccess_rid | 1 | 1 | 1 |
+-----+-----+-------------------+------------+--------------+--------------+
6 rows in set (0.00 sec)
When disabling and uninstalling, this table still exists; imho, this table should be dropped when uninstalling the module. This bug existed in the 5.x version and still exists in the 6.x branch.
However, after uninstalling the module, the table still exists, but looks empty:
mysql> select * from node_access;+-----+-----+-------+------------+--------------+--------------+
| nid | gid | realm | grant_view | grant_update | grant_delete |
+-----+-----+-------+------------+--------------+--------------+
| 0 | 0 | all | 1 | 0 | 0 |
+-----+-----+-------+------------+--------------+--------------+
1 row in set (0.00 sec)
The issue with invisible front page content respectively inaccesible nodes for anonymous users still exists on a site, that recently was upgraded to D6. This site once had the "Nodeaccess" module installed, but it was disabled and uninstalled months ago. Simply rebuilding the content access permissions did not fix this issue, I had to (re-) install and (re-) enable "Nodeaccess" module, rebuild content access permissions, then disable and uninstall this module to get anonymous access to (most of) my nodes for anonymous users back.
This problem occured several times in the last few months, but could always be "fixed" by this procedure. I'm not using any other content access modules on this site, except those provided by Drupal core, panels and views; I'm neither running "Actions permissions" nor "Content Permissions" (from CCK).
Greetings, -asb
#5
The node_access table is a core table used by drupal, it should not under any circumstance ever be dropped, it will break your site. The data written to that table is managed by drupal's core permissions system. This module merely provides the core permissions system data, which drupal uses in the node_access table.
The tables used by this module all start with nodeaccess (no underscore, which is somewhat confusing and was a bad choice at the time, but it would be tricky to change it now). They are properly removed when uninstalling.
After uninstalling permissions need to be rebuild to reset access control back to default. If you have a large site and rebuilding permissions times out or exhausts memory (note: this is a core drupal problem, not a problem with this module), you can do it manually with the following sql (I would strongly recommend backing up your database before doing this):
truncate table node_access;
insert into node_access (nid, gid, realm, grant_view, grant_update, grant_delete) values (0,0,'all',1,0,0);
This will reset drupal permissions back to the defaults, however the officially supported drupal way of doing this is to rebuild permissions through the administrative interface.
#6
Under admin/build/modules, if I deselect the Nodeaccess (5.x-1.2 in my case) module, my configuration change is not saved, and many nodes loose anonymous access permission. Fortunately, I can repair the damage with the SQL commands you kindly provided. Can you suggest a way to disable and uninstall the module?
Edited to add:
I found a way to disable and uninstall the Nodeaccess module and will share it should it benefit others: Within the module, I commented out every instance of
node_access_rebuild();, then disabled and uninstalled in the usual way.