Disabling a module which hold custom field(s) definition isn't possible; Drupal claiming "Required by: Drupal (Field type(s) in use - see Field list)" even if no instance of its field(s) exists.

In a normal situation this message occur when some data exists for the culprit field.

Running cron should empty the data but as the batch size is set to 10 (according to field_cron) more than one cron might me necessary. Alternatively this method can be tried: #1284332-14: Module cannot be disabled because Drupal claim "Field type(s) in use".

Developer information: Moving field(s) definitions into a separate module of a installed module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pillarsdotnet’s picture

Status: Active » Needs work

This information needs to move to a documentation page, and then a patch can change the "cannot uninstall" error message to refer to that documentation page.

drikc’s picture

I've done the documentation page. For the patch that make a link to it I'm not sure because the message could refer to another issue needing other solution.

pillarsdotnet’s picture

Issue tags: +Documentation

Need a link to the documentation page, please.

drikc’s picture

Title: Move field(s) definitions into a separate module of a installed module. » Module cannot be disabled because Drupal claim "Field type(s) in use"
pillarsdotnet’s picture

Ah, I see. By "documentation" page you are probably referring to Moving field(s) definitions into a separate module of a installed module.

Hmm...

That page has multiple problems:

  • There are many spelling and grammar errors.
  • It ought to be an API change node, not a regular documentation node.
  • It doesn't explain why the problem exists. (This could be copied from the issue summary page.)
  • It doesn't explain how to fix the problem by manual deletion of database records.
pillarsdotnet’s picture

pillarsdotnet’s picture

flexicode’s picture

I come from the other two popular and user friendly cms's background, Many warned me Drupal is not 'easy' but I took the plunge looking at the possibilities and it has been a while I am trying to complete one project in D7 without much success so far. Every now and then I find myself re-constructing my broken site than doing anything worthwhile. Now I am stuck here trying to figure out what to do. The writeup is too technical for me to follow. I have been warned not to finger the core.
I tried to test the media module (that I was following for a long time) and the media gallery module. I was delighted to know that media has finally advanced one step into a release candidate. Media Gallery module, after installation, declares that it is not compatible with media 7.1rc so I had to uninstall it and install what media gallery was looking for (7.1 beta5). I was happy to learn that the gallery has been installed, however when I tried to reach to my home page, I was thrown to my (admin's) profile page. Thinking that things might just not work out I turned back to disable the media thing along with the dependencies but it wouldn't.
Can someone help me solve the problem in a 'not so technical' language or should I consider turning back to my old pals after somehow completing this project, although I consider myself a hobbyist with enough knowledge of web technologies to make dynamic websites but Drupal appears to be a little too hot for me to handle.

anruether’s picture

After deleting the fields that were used with Media, I still can't disable Media module. Is there a way to disable the Media module right now?

drikc’s picture

Try to manually delete the field info in the field_config table in order to disable the module.

flexicode’s picture

I am on Drupal 7.8 stable and my modules list page shows "Required by: Drupal (Field type(s) in use - see Field list)" for the following modules...

CORE....
=============
File
Image
List
Number
Taxonomy
Text

OTHERS
=============
Date
Email
Node Reference
Node Reference Count
Media
Organic Groups

Meaning I won't be able to disable these modules if I ever want to. Is there anything that could be done to be out of this situation. Any suggestion, advice, workaround would be much appreciated.

drikc’s picture

There is two cases which can produce this situation:
1. Normal situation: a module field type is instanced (in use).
2. Abnormal situation: a module is implementing its own field definitions which since 7.8 must be implemented in a separate module, see this API change.

In case 2, you can either wait for a module update or delete the field info in table field_config.

drikc’s picture

Issue summary: View changes

Moved content to a documentation page.

flexicode’s picture

I deleted the field info in table field_config after that I was able to disable 'Media Gallery' and 'Media' modules and access my home page, however I still see some stale fields and data in the database table 'field_config_instance'. What should I do with those data? Please refer to the attached snap shot taken after completely uninstalling & removing the media_gallery & media modules.

Thanks for your solution drikc, it really helped.

drikc’s picture

Yes you could delete also the field info in field_config_instance and the field tables if you dont need its datas.

flexicode’s picture

Did the same and things are back on track, will avoid going near media or media gallery anytime soon though :)

You were a great help drikc, You rescued me from a hopeless situation. Thanks a lot.
Have nicer days ahead. :)

Jim Kirkpatrick’s picture

Category: task » bug

Subscribe... Got same issue when uninstalling the not-ready-yet Relation modules... Deleted all content, then deleted content type using a field for relationship endpoints, then uninstalled modules only to not be allowed to disable the now-unused Relation Endpoints Field module.

Something's not tidying itself properly, and D7 prevents the user doing it themselves by uninstalling. Nothing relevant shown at admin/reports/fields...

I deleted the offending rows from field_config (nothing relevant in field_config_instance) then the problem went away.

flexator’s picture

same issue. I had the Problem too and deleted the fields in field_config and all was good.

ouyang1512’s picture

I am having the same issue. What I am trying to do is update the core from 7.8 to 7.9. If I delete those content in field_config table, would the site be affected since I only need to disable the modules for update and will turn them back on?

The documentation is not that easy to understand and follow. Any clearer advices or work around for this issue? Much appreciate!

drupal a11y’s picture

@flexicode #8: You can use the gallery on the latest 1.x or 2.x dev if you remove the depency set in the media gallery .info file.

azabeti’s picture

Thanks drikc, deleting the associated record with 'media' in the module field in the field_config table allowed me to uninstall the modules.

rojesaga’s picture

It Work for me, trying to delete fields that no logner been used in any content type, profile or taxomony but still claim that were in use. THANKS A LOT.

rojesaga’s picture

Issue summary: View changes

Turn the in-line link into a nicer 'a' tag

drikc’s picture

Issue summary: View changes
drikc’s picture

Issue summary: View changes
drikc’s picture

Issue summary: View changes
thomasaaron’s picture

Thanks. Running Cron worked for me.