1

I've trying to make a simple module that creates a node-type and adds a few custom fields to it with the Field API.

Here is my module's .install

Here is my module's .module

The module installs just fine. After changing some things in my hook_install_fields, I disabled the module and uninstalled. When I try to re-enable the module, drush prompts me that one of the fields already exists and is active. My problem is that hook_uninstall doesn't seem to be deleting the fields from the database. If I manually delete the field tables from the database, I'm able to re-enable the module without error.

Can anyone point me in the right direction on this?

1
  • with is there an underscore? _customer_testimony_uninstall() Commented Feb 8, 2013 at 23:45

1 Answer 1

2

It looks like your uninstall hook is incorrectly named and not invoked.

Current (line 137):

function _customer_testimony_uninstall() {

Try change it to:

function customer_testimony_uninstall() {

(No underscore in the beginning)

1
  • This is right: Hook's names don't start with an underscore.
    – apaderno
    Commented Feb 8, 2013 at 23:15

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.