Xử chú Fields pending deletion stopping module unistall

2nd Jul 2022
Table of contents

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


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.

Bạn thấy bài viết này như thế nào?
0 reactions

Add new comment

Enter the characters shown in the image.
Câu nói tâm đắc: “Điều tuyệt với nhất trong cuộc sống là làm được những việc mà người khác tin là không thể!”

Related Articles

Recently I found myself needing to manage cookie data in Drupal 9 for the first time. As oft, my first step in the process was to search through Drupal core and the Drupal API for examples of “the right way” to handle cookies. After I didn’t find any reasonable existing solution within Drupal, it was time to solve this on my own.

Regardless of your position on either side of the web, there is always risk of being a victim of a cyber attack. This has put businesses in a tizz to make personal data of the visitors secure.

we had 5 domain on our website and we need to redirect a user to US domain if user is browsing from US

Migration from one version of Drupal to the other version of Drupal has always been important as it helps to move with time and stay updated with the latest technology.

in this article, I'll show you how to create custom controller with JSON response in Drupal 9