2

I have an installation of Drupal 7. I installed Field Collection module. I created a content type (Books), added a collection type field, and created a View showing these data. Now, I deleted the collection type field in Books, and now I am not able to uninstall the module. I have run cron and cache delete to no avail. The message displayed in the modules page is the following.

Field collection

7.x-1.0-beta11+13-dev
Provides a field collection field, to which any number of fields can be attached.
Requires: Entity API (enabled)
Required by: Drupal (Fields pending deletion)

0

2 Answers 2

0

From http://www.drupalwoo.com/content/blog/cant-disable-module-drupal-fields-pending-deletion :

All of us who have been working with Drupal for a while have run into this issue: you want to disable a module that you are no longer using, but it's grayed-out on the 'Modules' tab, and so you aren't able to disable and uninstall it.

It says Required by: Drupal (Fields pending deletion)

Required by: Drupal (Fields pending deletion)

Well, you know what this means, so you go to the fields list screen at /admin/reports/fields

You delete all the fields that were related to this module, you run cron multiple times (that's what all the replies to this problem say), and still, you cannot disable the module.

If this is happening to you, as it happened to me recently with the Geofield module, here's the quick fix:

Go into the field_config table in your Drupal database, and look for the field in question. It should say that the field in question has been deleted already:

Try running this query in your database.

    DELETE FROM `field_config` WHERE `field_config`.`deleted` = 1;

Then, clear the cache.

2
  • Thanks for the reply. I cannot believe this or the other solution (essentially the same) are not automatic. I was adviced to never ever, under any circumstance, to delete directly from the database.
    – Cesar
    Commented Aug 31, 2016 at 7:13
  • @Cesar another solution is Clear cache several Times :) I answer before him :D
    – Yuseferi
    Commented Aug 31, 2016 at 7:43
2

You can try this process

Log into database and ->

Select * from field_config where type = "field_collection"

Delete the rows

Same with field config instance table like

SELECT * FROM field_config_instance where entity_type = "field_collection";

Delete the rows

You can also check.

1.) first remove all the fields inside the Fields Collection.

2.) Then remove the field collection from the content type

3.) Run the Cron

4.) try to disable the module, if you cannot then Go ahead with first query statements above.

Get more details Here.

4
  • It worked without running cron. Shouldn't this procedure be automatic?
    – Cesar
    Commented Aug 31, 2016 at 7:12
  • No i think for field collection this not automatic. But i am not sure. You need to do more RND on it. Thank you :)
    – DRUPWAY
    Commented Aug 31, 2016 at 7:17
  • Well, after finding a extremely rare bug in Drupal I am used to deleting in core tables. It was a module not showing up. Still problems after uninstalling, installing again, deleting from MySQL tables. Finally, I had discovered that I had uploaded manually the folder of the module to modules and there were two copies, one in modules and the other one in sites/all/modules. It is incredible that Drupal does not throw an exception in that case. drupal.stackexchange.com/questions/180103/…
    – Cesar
    Commented Aug 31, 2016 at 7:27
  • What I have done - if field_catfood shows error, then find catfood in the MySQL, config table, and delete the keys- with field_catfood name
    – user105012
    Commented Jul 9, 2021 at 12:13

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