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?

Comments

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.
Cheers

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
Thanks!!

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

icf-vpathak’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

field_purge_batch(500);

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:
https://api.drupal.org/api/drupal/modules!field!field.module/function/fi...

Which in turn runs field_purge_batch:
https://api.drupal.org/api/drupal/modules%21field%21field.crud.inc/funct...

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++) {
    field_purge_batch(5000);
  }
darrell_ulm’s picture

field_purge_batch(500);
Worked in Drupal 7, thanks!

tamonten1’s picture

run cron work for me too, thanks

amazingrando’s picture

#37 worked to resolve this same issue in Drupal 8. :-)

serverjohn’s picture

#1 worked for me. I just ran cron once and it resolved my issue.

nattyweb’s picture

#2 worked for me - both for this module and for mass_contact, which was also refusing to uninstall.
Thank you!

guistoll’s picture

#1 worked for me. Running cron one time solved the issue.

nofue’s picture

Running cron still in 8.8.4 … Thanks for the hint.

solideogloria’s picture

#37 works best.

jaesperanza’s picture

On an updated D8.9.6 site from 8.9.2, encountered the "Fields pending deletion" error message in trying to uninstall the Geofield module, also after deleting an unused geofield. Running cron fixed it.