Download & Extend

Content Types Created by Features Can Not Be Deleted

Project:Features
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:irakli
Status:active

Issue Summary

If you install a feature that declares a content type, when feature is enabled a content type is created. However there is no way to get of the content type after that. Disabling feature has no effect. Content type can not be deleted from the content types admin UI because it's marked as non-custom and those can not be deleted due to following code in modules/node/content_types.inc:

<?php
     
// Set the delete column.
     
if ($type->custom) {
       
$row[] = array('data' => l(t('delete'), 'admin/structure/types/manage/' . $type_url_str . '/delete'));
      }
      else {
       
$row[] = array('data' => '');
      }
?>

which only allows deletion of non-custom content types.

There's a related, resolved issue in the D6 issue queue: http://drupal.org/node/521606 but clearly it is still a problem for D7.

Intended behavior, per Young Hahn's post in: http://drupal.org/node/521606#comment-1827418 is:

You should be able to delete content type from the database only if:
1. Content type definition has been overridden (edited)
2. Feature module has been disabled making the content type definition "orphaned".

Comments

#1

#2

I'm having exactly the same problem, disabled & uninstalled my feature and still no control..

Maybe its best to make an option to mark all content-types as non-custom again (I don't know if there is a way for features to see which where added by itself and not other modules):

- when uninstalling a feature (this is the related bug)
- when uninstalling the features module: some ppl want to disable all features implementation for a site (also see #663136: Provide way to Import views/true exportables back to the database)

thanks for all good work!

Greetings Bas

#3

I just tried disabling a feature with 7.x-1.0-beta6, and the commit that Febrarro mention in #54 in #1055460: Disabling a feature does not disown content type, http://drupalcode.org/project/features.git/commit/e00d7e5, does not seem to be functioning. I had to manually set the custom column. It's also possible the code just wasn't run because it took two tries to disable the feature (it went through two sets of "orphaned dependency" pages, once per each disable with different dependencies listed each time). That would mean this is more of a performance issue, which is a known issue with features (mega features = bad).

nobody click here