I've deleted all instances of field collections from their parent content type, and now wish to disable and uninstall the module. I am unable to do so - the field collection module is listed as "Required by: Drupal (Fields pending deletion)".

I have flushed all caches and run cron, with no change. Any thoughts?


perisdr’s picture

Try running cron multiple times. It took me two times. Other people said they ran cron up tp 6 times.

khalladay’s picture

Deleting the module folder, running cron, then replacing the module directory allowed me to disable the module. Got the idea from this issue: http://drupal.org/node/1284358

coert’s picture

@khalladay Thanks for the tip! Worked like a charm :)

fago’s picture

Category: bug » support
klonos’s picture

Yes, and this is actually a Drupal core bug/feature. It's not specific to the field_collection module.

mototribe’s picture

pikot’s picture

This worked for me too. Thanks!

tim.plunkett’s picture

Status: Active » Fixed

Per #2/#6

Konstantin Komelin’s picture

Thanks for the solution!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nycguyjason’s picture

This solution worked for me also.
It took 6 or 7 times of running the cron.

newtoid’s picture

Issue summary: View changes

I had to fire cron off about a dozen times, and it finally worked, thought i was stuck with it forever :-)

jaskaran.nagra’s picture

Deleting the module and then running cron worked the first time for me :)
I Deleted the module, ran the cron, copied the module back to where it was, and then disabled it from UI.

petermilad’s picture

Ironically running the cron did the job actually :D

Franz Phillips’s picture

Run cron x3 worked for me. Thank you

pslcbs’s picture

#2 Worked for me at the first try

joshua.boltz’s picture

I had to run cron 3 times before it actually allowed me to disable the field_collection module due to "Required by: Drupal (Fields pending deletion)".

stefanotabarelli’s picture

I had the same problem and this also worked for me
DELETE FROM `field_config` WHERE `field_config`.`deleted` = 1;

i just cleaned the cache after running the query and I was able to disable the module

gzveri’s picture

number #18 works fine : DELETE FROM `field_config` WHERE `field_config`.`deleted` = 1;

amitkumar_dds’s picture

Running Cron resolved this issue. !!

ioanniss’s picture

Number #18 works nice and fast!

ioanniss’s picture

Karim EL Shazly’s picture

thanks :) #2

v.pathak’s picture

Running Cron worked for me. Thanks

Benia’s picture

I am not sure if its connected but even though I ran cron 1 time it didn't change but I then remembered I have a view that was based upon the (already deleted content type & fields, of that module). After deleting the view I ran cron for the second time and could now remove it.

If it was also possible without deleting the view in a different copy of the site but in any way I wanted to write this here for any case.

pelicani’s picture

Don't waste time with cron.
Number #18 works nice and fast!

shahidbscs’s picture

Cron run one time and its worked magically instead to play with database :)

Alan D.’s picture

I had to run cron 3 times before it actually allowed me to disable the field_collection module due to "Required by: Drupal (Fields pending deletion)".

Deletes a massive 10 rows per cron run. So the number of runs could be high of you have a lot of data. We have a user field; 183 hours or 183 forced cron runs to go to delete the 1830 records...

tapas_tech’s picture

@perisdr Thanks man.. Run Cron x 1.. :)

johannez’s picture

Another option is to use this function through /devel/php


I had a lot of field data and it saved me in Drupal 8.

adriancid’s picture

drush php-eval 'field_purge_batch(500);'

Worked for me in Drupal 8

hockey2112’s picture

#18 worked for me. Thanks!

fabul’s picture

This khalladay's solution worked for me.

sriharsha.uppuluri’s picture

Thanks #2 worked for me

@Vignesh Soundararajan’s picture

Cron Run #2 Worked For Me

theicydeveloper’s picture

Ah running cron #1 worked for me.. Thanks!

ccjjmartin’s picture

For anyone wondering why cron works. It is because it runs field_cron:

Which in turn runs field_purge_batch:

If you have a lot of content and the default of 10 items is used you might be running cron forever before this works (in my case I had 100,000 nodes affected). You can manually run the drush command below a few times to speed things up:

drush php-eval 'field_purge_batch(10000);'

I ultimately added this code in an update hook for deployment after the removal of the field instances (which takes a while to run but gets the job done):

  for ($i = 0; $i <= 30; $i++) {