0

I just followed http://www.andypangus.com/drupal-7-adding-roles-to-users-dynamically to create a new content type. I am successfully able to create it, but when I uninstall the module, the content type is not getting deleted. I also cannot delete it from the admin interface; there is no delete option.

Why cannot I remove the content type? How should I remove it?

1

Make sure you actually uninstall the module as opposed to just disabling it.

Uninstall is an additional tab on Admin > Modules page.

If that doesn't work, you could try calling node_type_delete($type) from somewhere.

  • 1
    I have the code in uninstall hook at said in the URL andypangus.com/drupal-7-adding-roles-to-users-dynamically. It did not work. Also, i don't have delete button in the admin panel to manually delete it. Am i missing something in the code to make the delete option available in the admin panel – user13985 Feb 23 '13 at 15:38
  • 1
    @user13985 Try this: go to "manage fields" of the content type, and replace /fields with /delete on the URL – Beebee May 20 '14 at 15:39
0

There is an "Uninstall" tab in the admin interface for modules. Locate it and look under it. After you've disabled the module, the module will show up in the table of disabled modules in this "Uninstall" admin interface. There will be a small tick-box to the left of the name of the module. To delete the custom content type, you need to tick this box, and then press the "Uninstall" button located below this table.

There is no "Delete" option in the admin panel. However, pressing the "Uninstall" button runs the uninstall hook, which is what deletes the custom content type created by the module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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