[drupal-devel] Hook_settings() confusion

Gabor Hojtsy gabor at hojtsy.hu
Thu Jan 27 12:38:51 UTC 2005

> Yeah, sorry, should have noted that I realised it was the wrong place in
> the docs and checked the right place. I have links for all /core/ modules
> that implement it. But spam.module (which implements hook_settings) and my
> blacklist module (which also implements hook_settings) do not show up in
> this location.
> The menu generation code is a bit complex for me to grasp in a 15 minute
> peek when I should be working ;-) but I've been taking a look. It only
> appears to call hook_menu for modules, never hook_settings:
>   // Build a sequential list of all menu items.
>   $menu_item_list = module_invoke_all('menu', TRUE);
> spam.module and my module are both enabled just like blog and blogapi. If I
> go directly to the URL for a module, admin/settings/spam for example, it
> works, which would suggest that menu.inc is loading it in somewhere that I
> couldn't see whilst looking, but not marking it as visible perhaps?
> I can't really spend any more time looking at this today, better do some
> "real" work I suppose. If anyone could explain to me why I'm not getting
> spam.module or mine displaying, but am getting the core modules, it would
> help!

Resubmit your module enabling page (administer >> modules) or otherwise 
empty the cache, so that the menu gets regenerated. If you have a module 
without the settings hook enabled, and then replace the code under 
Drupal to something with the settings hook, it will not get into the 
menu, due to menu caching. Drupal expects no code changes in files 
unless you resubmit the module enabling page, or otherwise empty the cache.


More information about the drupal-devel mailing list