The API for node_access_rebuild() has a note that modules should not call this in hook_enable() anymore, and should instead call node_access_needs_rebuild() so that the user can rebuild it themselves.

http://api.drupal.org/api/function/node_access_rebuild/6

I think this is also true for a case where it takes a really long time to rebuild node access. In my case, I need to enable the module, not rebuild node access, perform some operations in my hook_update() and only after those custom operations are done, rebuild node access. Rebuilding twice would not be a very viable option.

Comments

sirkitree’s picture

Status: Active » Needs review
Index: private.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/private/Attic/private.module,v
retrieving revision 1.1.2.2.2.8
diff -u -p -r1.1.2.2.2.8 private.module
--- private.module	9 Jul 2009 18:34:24 -0000	1.1.2.2.2.8
+++ private.module	30 Jun 2010 11:45:26 -0000
@@ -20,7 +20,7 @@ define('PRIVATE_ALWAYS', 3);
  * when it is enabled to ensure that things are set up.
  */
 function private_enable() {
-  node_access_rebuild(TRUE);
+  node_access_needs_rebuild();
 }
 
 /**
@@ -31,7 +31,7 @@ function private_enable() {
  */
 function private_disable() {
   private_disabling(TRUE);
-  node_access_rebuild(TRUE);
+  node_access_needs_rebuild();
 }
 
 /**
simon georges’s picture

Status: Needs review » Reviewed & tested by the community

Sounds good !

adamps’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)

Looks like this has been done now in D7