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

8.0.x
webchick 2013-01-02 08:53:20 -08:00
parent a82e9ea966
commit 25ad0ea49b
2 changed files with 17 additions and 1 deletions

View File

@ -9,6 +9,7 @@ namespace Drupal\edit\Plugin;
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;
}
}
}

View File

@ -16,7 +16,8 @@ use Drupal\Core\Annotation\Translation;
*
* @Plugin(
* id = "test_processed_editor",
* title = @Translation("Test Processed Editor")
* title = @Translation("Test Processed Editor"),
* module = "edit_test"
* )
*/
class TestProcessedEditor extends ProcessedTextEditorBase {