Can't remove computed field

Created on 2 June 2023, over 1 year ago
Updated 5 June 2023, over 1 year ago

Problem/Motivation

My version of Drupal is 9.5.9.
I was deleting all my computed field on my site and I want to uninstall computed_field module but I can't due to a message that says that some fields is waiting to be deleted.
I checked in the field dashboard and thereis no more field with type computed field and I was deleting all tables in my database contains the "deleted" word.
Since I was upgrade computed_field to 4.X version, I have an error when delete all sort of fields :
Drupal\Component\Plugin\Exception\PluginNotFoundException : The "field_item:computed_string_long" plugin does not exist.

If you have any solution to resolve this issue and to help me removing this module ?

Steps to reproduce

Delete all computed field then uninstall module : drush pm-uninstall computed_field
A message appears : computed_field: Fields are still waiting to be delete

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

4.0

Component

Code

Created by

🇫🇷France dcoppel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dcoppel
  • 🇬🇧United Kingdom joachim

    > Since I was upgrade computed_field to 4.X version, I have an error when delete all sort of fields :
    Drupal\Component\Plugin\Exception\PluginNotFoundException : The "field_item:computed_string_long" plugin does not exist.

    That's a field type from the 3.x version of the module.

    I'm not sure how you're going to manage to unpick that. Reverting to 3.x probably is going to cause other problems. Maybe temporarily copy in the computed_string_long plugin so you can delete the fields?

    (Please don't use tags for random keywords.)

  • 🇫🇷France dcoppel

    Hi,
    I copied modules/contrib/computed_field/src/Plugin/Field/FieldFormatter/ComputedStringFormatter.php from version 3 to version 4 of computed_field then I made a drush cr. After trying to delete a field I have the same issue. Is there something more to do ?
    Thanks for your help.

  • 🇫🇷France dcoppel

    I tried to downgrade to version 3. If I delete a field, error is :
    Drupal\Core\Database\DatabaseExceptionWrapper : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bdd.drupal_field_deleted_data_877caea112' doesn't exist: SELECT DISTINCT "t"."entity_id" AS "entity_id" FROM "drupal_field_deleted_data_877caea112" "t" WHERE "bundle" = :db_condition_placeholder_0 LIMIT 10 OFFSET 0; Array ( [:db_condition_placeholder_0] => bdd ) dans Drupal\Core\Entity\Sql\SqlContentEntityStorage->readFieldItemsToPurge() (ligne 1665 de core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

  • 🇬🇧United Kingdom joachim

    > I copied modules/contrib/computed_field/src/Plugin/Field/FieldFormatter/ComputedStringFormatter.php

    That's the wrong plugin. field_item:computed_string_long is a FieldTYPE plugin, not a FieldFORMATTER.

  • 🇫🇷France dcoppel

    Thanks for your reply.
    I solved my issue by doing that was described on this page : https://drupal.stackexchange.com/questions/230156/how-can-you-completely...
    After this action, removing computer_field and the issue when deleted a field was both solved !
    Thanks for your help.

Production build 0.71.5 2024