diff -u b/core/modules/filter/src/Entity/FilterFormat.php b/core/modules/filter/src/Entity/FilterFormat.php --- b/core/modules/filter/src/Entity/FilterFormat.php +++ b/core/modules/filter/src/Entity/FilterFormat.php @@ -390,13 +390,20 @@ /** * {@inheritdoc} */ + public function removeFilter($instance_id) { + unset($this->filters[$instance_id]); + $this->filterCollection->removeInstanceId($instance_id); + } + + /** + * {@inheritdoc} + */ public function onDependencyRemoval(array $dependencies) { $changed = FALSE; - $plugins = $this->getPluginCollections(); - foreach ($plugins['filters'] as $plugin) { - if (in_array($plugin->provider, $dependencies['module'])) { - drupal_set_message($plugin->getPluginId()); - $this->setFilterConfig($plugin->getPluginId(), array('status' => 0)); + $filters = $this->filters(); + foreach ($filters as $filter) { + if (in_array($filter->provider, $dependencies['module'])) { + $this->removeFilter($filter->getPluginId()); $changed = TRUE; } } only in patch2: unchanged: --- a/core/modules/filter/src/FilterFormatInterface.php +++ b/core/modules/filter/src/FilterFormatInterface.php @@ -84,4 +84,12 @@ public function getFilterTypes(); */ public function getHtmlRestrictions(); + /** + * Removes a filter. + * + * @param string $instance_id + * The ID of a filter plugin to be removed + */ + public function removeFilter($instance_id); + }