There is a minor problem that shows up in a fairly complicated interaction with module_implements and hook_enable.

Because of the way module_implements caches, when a module is enabled, none of its hooks will appear in module_implements. This can be a problem in module_enable; particularly with the node_access_rebuild() function which checks module_implements to determine its behavior. In that instance, it gets the wrong behavior because the count is incorrect and it believes that the module being enabled doesn't exist.

Comments

harry slaughter’s picture

Assigned: Unassigned » harry slaughter
harry slaughter’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

comment from chx

http://drupal.org/node/80488 very easy, add a $reset = FALSE to module_implements and act on it. if it's true delete the array and pass it to module_list

this patch does the above.

i'm not entirely clear on the context module_implements() but from what I think I understand of it, shouldn't we set $reset to TRUE by default?

this is a patch against HEAD Sep 11 21:43

moshe weitzman’s picture

Version: x.y.z » 5.x-dev
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.03 KB

works as advertised. reroll to fix minor code style issue

drumm’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

http://drupal.org/node/93212 was recently committed, which I think is the same issue as this. Please correct if I'm wrong.