Closed (fixed)
Project:
Node access user reference
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Dec 2011 at 07:17 UTC
Updated:
4 Jan 2012 at 07:20 UTC
I have problems Rebuilding content access permissions, using both your module and ABT.
I found that this module generates a node_access record for almost evey node, while only a fraction if my node have a node_access_userreference field. They are explicitly created in hook_node_access_records().
(Why) is that necessary?
Comments
Comment #1
danielb commented"Problems" ?
"ABT" ?
What do you mean by "only a fraction if my node have a node_access_userreference field"? Can you be more explicit in what leads you to this claim?
Also, provide me with an explanation of how you have configured your user reference fields, in the various content types.
This module certainly is not designed to create access records for unaffected nodes.
Comment #2
johnvThanks for your quick response, I just realized I had to add some more information..
This is my problem: #1360896: Rebuild permissions generates Fatal error: spl_autoload(): Class Database could not be loaded in database.inc on line 2412
However, that does not occur when only NA_UR is enabled, but it did make me look at the node_access table better than before.
NA_UR works very fine after the updates from last summer.
I updated to latest version.
I have no other access-modules enabled.
I have a content type with 1 field relevant for NA_UR. These are the settings:
And this is what is generated - a line for each node:
Comment #3
danielb commentedWhoa that's different, haven't heard of this before.
The lines in the database you see are not created by nodeaccess_userreference, but by Drupal core. They simply mean that everyone is allowed to view the node. Every node must have a node access record by the design of Drupal.
I don't think I can help you, I have never got that error before or even heard about it. It seems like one (or more) of your nodes is corrupted somehow?? The node access rebuild process loads every node on the site, so when that node is loaded something goes wrong.
You need to narrow down this problem a bit more, hack the file where the error is coming from and add a debug_backtrace() and try to figure out what happened.
Comment #4
johnvThis seems normal behaviour by node.module:
node_save() calls node_access_acquire_grants(). Here, a default value is inserted for every node that is not affected by a node_access-module.
node_access_rebuild() generates one (1) record in node_access table if no access-control module is implemented.
array('nid' => 0, 'realm' => 'all', 'gid' => 0, 'grant_view' => 1, 'grant_update' => 0, 'grant_delete' => 0,)Just for confimration ad reassurance, if you have an installation with nodes that are not affected by any node-access module, are they still in youd node_access-table?
Thanks for your support.
Comment #5
danielb commentedYes every node is in the node access table, even with no node_access modules
Comment #6
johnvComment #7
danielb commentedThe only exception to the default node access record is nodes that are unpublished AFAIK.