Without these hooks, there is no way to uninstall a module. So there is no way to clear the module out of the system table.

This becomes a problem if you subsequently add the install()/uninstall() hooks. The install hook will never run. You can only disable the module but then enabling the new version the install() hook won't run.

So it seems it's good practice to always have these hooks if if they do nothing.

Comments

stella’s picture

Status: Active » Closed (won't fix)

I'm not sure this is a good idea. If a module doesn't create any tables or do any setup when it's first installed, then there's no need for a hook_install(). If an install function is added at a later stage that modifies the database, then an update handler (hook_update_N()) should be provided to update existing installations.

I really don't see the need for such a check, so marking as won't fix.

mattyoung’s picture

Perhaps I over explain this thing. Let me try again:

Without install()/uninstall() hooks, there is no way to truly uninstall the module. You can only disable. There will be an entry in the system table forever even if you delete the module.

stella’s picture

I still don't see the need for a hook_uninstall() if the module doesn't create any tables. I'm not too concerned about an entry in the system table.