Skip to content
Snippets Groups Projects
Commit 25ad0ea4 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1875098 by tim.plunkett: Fixed Edit's processed text editor plugins bleed into test runs

parent a82e9ea9
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -9,6 +9,7 @@
use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Component\Plugin\Factory\DefaultFactory;
use Drupal\Component\Plugin\Discovery\ProcessDecorator;
use Drupal\Core\Plugin\Discovery\AlterDecorator;
use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
use Drupal\Core\Plugin\Discovery\CacheDecorator;
......@@ -23,9 +24,23 @@ class ProcessedTextEditorManager extends PluginManagerBase {
*/
public function __construct() {
$this->discovery = new AnnotatedClassDiscovery('edit', 'processed_text_editor');
$this->discovery = new ProcessDecorator($this->discovery, array($this, 'processDefinition'));
$this->discovery = new AlterDecorator($this->discovery, 'edit_wysiwyg');
$this->discovery = new CacheDecorator($this->discovery, 'edit:wysiwyg');
$this->factory = new DefaultFactory($this->discovery);
}
/**
* Overrides Drupal\Component\Plugin\PluginManagerBase::processDefinition().
*/
public function processDefinition(&$definition, $plugin_id) {
parent::processDefinition($definition, $plugin_id);
// @todo Remove this check once http://drupal.org/node/1780396 is resolved.
if (!module_exists($definition['module'])) {
$definition = NULL;
return;
}
}
}
......@@ -16,7 +16,8 @@
*
* @Plugin(
* id = "test_processed_editor",
* title = @Translation("Test Processed Editor")
* title = @Translation("Test Processed Editor"),
* module = "edit_test"
* )
*/
class TestProcessedEditor extends ProcessedTextEditorBase {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment