Problem/Motivation
As mentioned in the title "Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist"
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "blazy_filter" plugin does not exist. Valid plugin IDs for Drupal\filter\FilterPluginManager are: editor_file_reference, filter_caption, filter_url, filter_null, filter_autop, filter_htmlcorrector, filter_html, filter_html_image_secure, filter_align, filter_html_escape, media_embed, video_embed_wysiwyg in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
Steps to reproduce
- Create a new Drupal instance
- Install a new filter plugin (you can install drupal/blazy)
- Dump the database ^^ (I use ddev export-db)
- Now disable the installed module (maybe drupal/blazy)
- Export your configuration
- Import the dump (I use ddev import-db)
- Run drush cim
Why dump/import db ? Let's say you have a production website with drupal/blazy, then you read the news "Drupal 9 support lazy loading". Now you did some changes in your Local environnement, removing drupal/blazy (I'm not against keeping it :lol). Now you will need to deploy this ? Don't ^^ The "" plugin does not exist
Proposed resolution
Something :lol:. core/modules/filter/src/Element/ProcessedText.php run all the time (even with drush cim -_- ) and call
/** @var \Drupal\filter\Entity\FilterFormat $format **/
$format = FilterFormat::load($format_id);
Which simply load all the filters (you are trying to remove one with drush cim). Well you can't ask for something you are trying to remove bro.
:tada:
Maybe adding a new check for providers before loading the filters ??
$provider = $this->extractProviderFromDefinition($plugin_definition);
if ($provider && !in_array($provider, ['core', 'component']) && !$this->providerExists($provider)) {
unset($definitions[$plugin_id]);
}
I can't find the loading function