Score:2

Removing phantom plugin from database

fr flag

On several sites I've worked on, for whatever reason before I put my hands on it, the database seems to register a plugin that is no longer in config or code.

This usually goes as follows:

[error] Drupal\Component\Plugin\Exception\PluginNotFoundException: The "name-of-plugin" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition()

In D7, it was relatively straightforward to delete offending module entries from the database. What tables store plugin data so I can tell Drupal to stop looking for them and whitescreening when they can't be found?

Score:6
cn flag

Export the entire config, either in UI or via drush cex. Then make a full-text search for the plugin name. Remove the configuration causing the error and import the config again drush cim.

BTW if you turn on full error messages at admin/config/development/logging you see more info on which code is trying to load the plugin. This can point to a code line using a config object or a hard-coded plugin name.

If you can't access the admin UI because of the error add this option to settings.php:

/**
 * Show all error messages, with backtrace information.
 *
 * In case the error level could not be fetched from the database, as for
 * example the database connection failed, we rely only on this value.
 */
$config['system.logging']['error_level'] = 'verbose';

Or activate web/sites/example.settings.local.php from where this is copied.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.