install() function in .install file won't run?

Straddle - January 10, 2009 - 00:11

So after fiddling with the admin and front end of my module for awhile, turning it off and on, off and on I reached the point where I need to create a .install file for it and an install method.

I go about creating it, having it generate required content types for what my module does. The problem is the install() method never runs at all. I've disabled my module and re-enabled it numerous times and it just won't run?

Do I need to do this in an update() method since I've already enabled my module once or twice? Or is there some module cache which needs to be cleared in the db?

Thanks in advance!

st.

Have you uninstalled your

mradcliffe - January 10, 2009 - 00:18

Have you uninstalled your module completely or just disabled it?

You could try setting up a new development environment and testing it again.

By completely do you mean

Straddle - January 10, 2009 - 00:57

By completely do you mean having to remove it from the directory structure as well? I just disable it under the Modules admin area and then re-enable it? I thought that was as good as an uninstall?

Best,

st

UPDATE: I tried completely

Straddle - January 10, 2009 - 01:00

UPDATE: I tried completely removing it from the module directory structure as well and then redeploying it. Still won't run.

Best,

st

No I mean clicking on the

mradcliffe - January 11, 2009 - 15:48

No I mean clicking on the uninstall tab (on the modules' admin page) and toggling the uninstall option for your module.

*BUMP* Any ideas anyone????

Straddle - January 11, 2009 - 00:22

*BUMP*

Any ideas anyone????

Options

Heine - January 11, 2009 - 17:26

There are a number of options. Among them

  1. Implement hook_uninstall (an empty function will do) and uninstall the module (via tab on modules page)
  2. Execute the query "DELETE FROM system WHERE name = 'yourmodule_name';

--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.

Thank you sir! This worked.

Straddle - January 11, 2009 - 18:20

Thank you sir! This worked. Was not aware that I required an _uninstall hook as well to ensure that the install() runs when re-enabling.

Best,

Paul

 
 

Drupal is a registered trademark of Dries Buytaert.