I'm implementing hook_node_grants() in a module. I thought that I would call node_access_rebuild() from both the implementation of hook_enable() and hook_disable(). I realized that the line in node_access_rebuild()

if (count(module_implements('node_grants'))) {

counts my disabled module also as implementing 'node_grants'. This is a bug. Only the enabled modules should be counted.

Comments

attila75’s picture

Title: node_access_rebuild() should not count disabled modules » hook_disabled should be added

I realized that my previous statement about node_access_rebuild() was not true: it does not have that bug. However it is too early to call node_access_rebuild() from the implementation of hook_disable. This is understandable according to the documentation of hook_disable: "Perform necessary actions *before* module is disabled." Therefore there is a need for a hook which is called *after* the module is disabled. This would be a nice place to call node_access_rebuild().

attila75’s picture

Component: node system » other

Not sure about the right component for this bug, since the change should go to module_disable() in module.inc (I guess).

bwynants’s picture

+1 for same reason.

dpearcefl’s picture

Status: Active » Closed (won't fix)

Considering the age of this issue with no comments and that Drupal 5 is no longer supported, I'm closing this ticket.