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?

  • 1
    Put the deleted code back, uninstall the module, et voila – Clive Jan 27 '17 at 21:29
  • Fortunately the code still existed in our git repo. It worked perfectly! – Greenstack Jan 30 '17 at 21:17
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, privacy policy and cookie policy

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