Xử chú Fields pending deletion stopping module unistall
2nd Jul 2022How to delete manually?
I'm getting a "Fields pending deletion" error when trying to uninstall the Dynamic Entity Reference module. I also cannot disable the module as the tick is greyed out (unless I'm missing how to disable modules in Drupal 8).
I've run cron and cleared the caches many, many times and have checked /admin/reports/fields but there is no mention there of any fields using this module.
I have found suggestions for Drupal 7 saying to delete the fields from the field_config database table but this table does not exist in Drupal 8. Is there any way to get rid of these zombie fields? They must be stored somewhere!
Please don't tell me to use Drush, I wish I could, believe you me, but I don't have shell access, just sftp and phpmyadmin.
I encountered the same issue with a field which was used in 7000+ entities, while the purge_batch_size: 1000 is not work, increase the number to over 7000 works.
So
purge_batch_size: 10000
works for my instance.
I solved this problem just by execute the following command:
drush php-eval 'field_purge_batch(10000);'
It turns out that deleted fields in Drupal 8 are stored in the key_value table.
To find them:
select * from key_value where name = "field.field.deleted" or name = "field.storage.deleted"
The values are stored as a blob, but can be viewed (e.g. in phpmyadmin you can click on it to download, and view in vim or similar). The value does not make much sense to a human, but having gone through the code printing and error-logging various things it was clear to me that these entries were what was holding up the uninstall. I backed up the table and deleted the entries, and then was able to uninstall the module.
Add new comment