0

Long story short, in developing a website in Drupal 8 we decided that the custom entity we were building could just as easily be made with standard nodes. We deleted the entity code (or something to that effect) and now, somewhere hidden in the database, is the definition for the team entity that we've removed. Fortunately, this isn't causing too many issues. However, when deleting fields from a content type (and probably in some other circumstances of which I'm not yet aware), we get the following error:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "team" entity type does not 
exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 133 of 
[...]/core/lib/Drupal/Core/Entity/EntityTypeManager.php).`

I've attempted doing what was suggested here, but it resulted in the above error.

What can I do to clean up the database/website so this error stops happening?

2
  • 1
    Put the deleted code back, uninstall the module, et voila
    – Clive
    Commented Jan 27, 2017 at 21:29
  • Fortunately the code still existed in our git repo. It worked perfectly!
    – Greenstack
    Commented Jan 30, 2017 at 21:17

1 Answer 1

2

First solution (the best one if you can) (thanks @Clive) :

  • Put the deleted code back
  • Uninstall the module
  • Reinstall the module with the new code

Second solution (ugly, but worked for me)

  • Open your favorite SQL client (adminer in my case)
  • Search for your entity id in all tables
  • Remove all matching entries
  • Clear the cache

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.