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?
1 reaction

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

Hướng dẫn từng bước set up một project PHP theo mô hình MVC. Bạn có thể sử dụng source này để tiết kiệm thời gian set up cho project của mình.

All examples are example-style, which means they don't follow best practices (e.g. dependency injecton). This is done to keep them as simple as possible.

The rapid evolution of diverse interfaces and applications has given rise to a dizzying array of digital channels to support.

Under Form Validation Define Counter - Character, Countet Maimum - 1000, Counter Maximum Message - %\%d Characters remaining