1

I am new to Drupal development and was working on a module. It has since gotten entirely screwed up. This is in Drupal 7. The module was adding a field type with a widget and some theming. It also created several new tables.

My module does not show up in the module list, and it does not show up in the uninstall list either. I see that it is still listed in the system table, and I had manually disabled it there (and did the clearing in the cache_bootstrap table). I removed the entire module folder at one point and have tried with it there and not there, clearing cache at each step.

Though I could live with the module still being "in the system", I would greatly prefer not to. I also have the major problem of I can not create a module with that name anymore as adding in a folder (even with a new, much simpler codebase for the module) does not make it show up in the list. To make matters worse this is a group project so it is not as if I could just start with a clean install of Drupal and start over.

So I am curious how I could remove the existing module so that I am able to "start over" with my own module?

Thanks!

1 Answer 1

2

You should pay close attention to the Module developer's guide on Drupal.org.

To appear in the lists, the module should be placed in its own sub-directory like modules/modulename, and it must have a properly configured modulename.info file in addition to a file named modulename.module.

If you have properly segregated the functions into the proper files, there should be no problem. Drupal will detect them automatically and will maintain an entry in the system table for the module. You should be able to activate or deactivate the module normally.

The installation routines (which are used to create or to remove the tables should be handled by functions in a modulename.install file. Drupal will look for the modulename.install file to see what tasks are required for installation or removal of the module.

My first advice would be to make sure that the module is correctly structured, and let Drupal handle the deactivation and uninstall, but you can do it manually if all else fails.

Deactivate the module and drop the tables using queries directly on the database. Start by looking for the definition in the system table.

UPDATE system SET status=0 WHERE type='module' AND name = 'modulename';

Then manually DROP any tables your module created and remove any variables it created.

5
  • Thanks for the reply! I believe module is set up correctly. I have a .install, .info, and .module file in there. That allowed me to install it. Once it was installed it disappeared from the module's list, but I was able to use the module still. Now I want to scrap the whole thing and start over, but I create a module (in the sites/all/modules/custom directory, is that a problem?) with a .info and .module with the same name but it doesn't appear on the list. Will I have to name my module something different to get it to show up again? Is it safe to delete the row from the system table entirely?
    – 2bsharpdev
    Commented Jul 26, 2013 at 13:39
  • I would guess the problem is in the format of the .info file, but you have not given us much information. Let Drupal handle the row in the system table.
    – Triskelion
    Commented Jul 26, 2013 at 15:27
  • Here is my info file: name = Nutrition description = Nutrition info data package = Recipe core = 7.x
    – 2bsharpdev
    Commented Jul 26, 2013 at 18:37
  • Looks fine. I assume that each key value pair is on a separate line. Have you cleared your caches?
    – Triskelion
    Commented Jul 26, 2013 at 19:13
  • Yes they are on a separate line. Yeah multiple times. Its just so bizarre because I turned on devel and the query it runs would return the nutrition module.
    – 2bsharpdev
    Commented Jul 26, 2013 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.