Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
perisdr CreditAttribution: perisdr commentedTry running cron multiple times. It took me two times. Other people said they ran cron up tp 6 times.
Comment #2
khalladay CreditAttribution: khalladay commentedDeleting 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
Comment #3
coert CreditAttribution: coert commented@khalladay Thanks for the tip! Worked like a charm :)
Comment #4
fagoComment #5
klonosYes, and this is actually a Drupal core bug/feature. It's not specific to the field_collection module.
Comment #6
mototribe CreditAttribution: mototribe commentedthis solution worked for me #1530812: Field collection cannot uninstall cleanly due to "Required by: Drupal (Fields pending deletion)"
Comment #7
pikot CreditAttribution: pikot commentedThis worked for me too. Thanks!
Comment #8
tim.plunkettPer #2/#6
Comment #9
Konstantin Komelin CreditAttribution: Konstantin Komelin commentedThanks for the solution!
Comment #11
nycguyjason CreditAttribution: nycguyjason commentedThis solution worked for me also.
It took 6 or 7 times of running the cron.
Comment #12
newtoidI had to fire cron off about a dozen times, and it finally worked, thought i was stuck with it forever :-)
Comment #13
jaskaran.nagra CreditAttribution: jaskaran.nagra commentedDeleting 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
Comment #14
petermilad CreditAttribution: petermilad commentedIronically running the cron did the job actually :D
Comment #15
Franz Phillips CreditAttribution: Franz Phillips commentedRun cron x3 worked for me. Thank you
Comment #16
pslcbs CreditAttribution: pslcbs commented#2 Worked for me at the first try
Thanks!!
Comment #17
joshua.boltz CreditAttribution: joshua.boltz commentedI 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)".
Comment #18
stefanotabarelli CreditAttribution: stefanotabarelli commentedI 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
Comment #19
gzveri CreditAttribution: gzveri commentednumber #18 works fine : DELETE FROM `field_config` WHERE `field_config`.`deleted` = 1;
Comment #20
amitkumar_dds CreditAttribution: amitkumar_dds commentedRunning Cron resolved this issue. !!
Comment #21
ioanniss CreditAttribution: ioanniss commentedNumber #18 works nice and fast!
Comment #22
ioanniss CreditAttribution: ioanniss as a volunteer commentedComment #23
Karim EL Shazly CreditAttribution: Karim EL Shazly commentedthanks :) #2
Comment #24
icf-vpathak CreditAttribution: icf-vpathak commentedRunning Cron worked for me. Thanks
Comment #25
Benia CreditAttribution: Benia commentedI 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.
Comment #26
pelicani CreditAttribution: pelicani commentedDon't waste time with cron.
Number #18 works nice and fast!
Comment #27
shahidbscs CreditAttribution: shahidbscs commentedCron run one time and its worked magically instead to play with database :)
Comment #28
Alan D. CreditAttribution: Alan D. commentedDeletes 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...
Comment #29
tapas_tech CreditAttribution: tapas_tech commented@perisdr Thanks man.. Run Cron x 1.. :)
Comment #30
johannez CreditAttribution: johannez as a volunteer commentedAnother 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.
Comment #31
adrianciddrush php-eval 'field_purge_batch(500);'
Worked for me in Drupal 8
Comment #32
hockey2112 CreditAttribution: hockey2112 commented#18 worked for me. Thanks!
Comment #33
fabul CreditAttribution: fabul as a volunteer commentedThis khalladay's solution worked for me.
Comment #34
sriharsha.uppuluri CreditAttribution: sriharsha.uppuluri commentedThanks #2 worked for me
Comment #35
Vignesh soundararajan CreditAttribution: Vignesh soundararajan commentedCron Run #2 Worked For Me
Comment #36
theicydeveloper CreditAttribution: theicydeveloper commentedAh running cron #1 worked for me.. Thanks!
Comment #37
ccjjmartin CreditAttribution: ccjjmartin at Four Kitchens commentedFor 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):
Comment #38
darrell_ulm CreditAttribution: darrell_ulm as a volunteer commentedfield_purge_batch(500);
Worked in Drupal 7, thanks!
Comment #39
tamonten1 CreditAttribution: tamonten1 commentedrun cron work for me too, thanks
Comment #40
amazingrando#37 worked to resolve this same issue in Drupal 8. :-)
Comment #41
serverjohn CreditAttribution: serverjohn commented#1 worked for me. I just ran cron once and it resolved my issue.
Comment #42
nattyweb CreditAttribution: nattyweb commented#2 worked for me - both for this module and for mass_contact, which was also refusing to uninstall.
Thank you!
Comment #43
guistoll CreditAttribution: guistoll commented#1 worked for me. Running cron one time solved the issue.
Comment #44
nofue CreditAttribution: nofue as a volunteer commentedRunning cron still in 8.8.4 … Thanks for the hint.
Comment #45
solideogloria CreditAttribution: solideogloria commented#37 works best.
Comment #46
jaesperanza CreditAttribution: jaesperanza commentedOn 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.