Hi all

After upgrading from Drupal 5.2 to 5.3 the table node_access seems to be broken. When I add content to the page, drupal doesn't create an entry in the node_access table so the users can't view the new content.
When i edit old content, drupal deletes the entry in de node_access table...

Any ideas?

Comments

sotzing’s picture

I'm having the same exact problem. node_access lists the gid as 0 for all rows and is denying users access to their own content. If I can't get this figured out in the next few hours, I'm going to have to revert back to 5.2.

If you see this post and have any advice/info/compaints to offer, shoot me an AIM IM at 'goofyrider' or email me at andrew@mobilegreetings.com

Thanks!
Andrew

ebeyrent’s picture

I seem to be having the same problem on 5.3, only it's intermittent. Most of the time, content gets created without any issues. However, there are times when content gets created, but an entry in node_access does not occur. I am seeing this across multiple content types, including blogs, events, volunteer-timeslots, and uprofiles.

If an administrator re-submits the content without making any changes, the node_access entry occurs and the content is viewable.

Any thoughts?

sotzing’s picture

Hey,
After diving into the node.module code i found where this node_access deletion is taking place. In the node_access_write_grants() function, I commented out the db_query line (for me line 2926) which essentially prevents Drupal from removing node_access entries.

I then have a line of code in my hook_nodeapi implementation within my custom module (not sure if you're writing a module or not, but now might be a good time to check it out) which basically add a node_access everytime a node is 'inserted' into drupal.

switch($op) {
     case 'insert':
        db_query( "INSERT INTO {node_access} VALUES ( %d, %d, '%s', %d, %d, %d )", $node->nid, 0, 'all', 1, 0, 0);
}

SUPER hacky, i know - but for the time being it'll work for me (and hopefully you too)

good luck!
Andrew

serkan_isin’s picture

I made a huge mistake and accidently deleted (node_access) instead of nodeaccess. And now i can not find how to create a new one? My site is unreacable to all users except me?

Any help?

--------------------------------
www.poetikhars.com

Ground Unit’s picture

Having the same problem. Any solution?