Closed (fixed)
Project:
Node access password
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Mar 2010 at 00:54 UTC
Updated:
30 Dec 2010 at 06:00 UTC
I'm evaluating the use of this module on a site with tens of thousands of users and nodes. From this section of code in nodeaccess_password_user():
elseif ($op == "after_update" || $op == "insert") {
node_access_rebuild();
}
it looks like the entire node access table is rebuild on creation or update of a user. Is this intentional, and if so, is there a way to do it wiithout rebuilding the whole thing (which will timeout on sites with a lot of content)?
Comments
Comment #1
danielb commentedI guess it is intentional in the fact that the nodes need to be rebuilt and checked for the password. Drupal 6 does discourage using this function though for exactly the reasons you said.
It is possible to change it to node_access_needs_rebuild(), which is the preferred way of rebuilding in drupal 6 (it deosn't time out) but the massive flaw in that is that it isn't automatic, and requires an admin to come to the site and do the rebuild manually.
Otherwise you'd have to rebuild nodes individually somehow, by choosing them a smarter way. Perhaps adding them to a queue and going through a handful of them on each page load, or cron, or something.
If you have your head in this at the moment, perhaps you could figure out a way?
Comment #2
danielb commentedI have create a 3.x branch which will appear soon. It doesn't rebuild the entire node access table, but uses this module to silently update the nodes it needs: http://drupal.org/project/node_access_rebuild_bonus
untested for now
Comment #3
danielb commentedActually .. come to think of it .. I don't think there is any reason to update any nodes upon updating/inserting a user... the nodes are already updated by the node module when any operation is performed on them... hmm....
Comment #4
danielb commentedok I've removed rebuilding altogether for the 3.x branch.