diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc index f87d9a0..632f1ec 100644 --- a/core/modules/aggregator/aggregator.admin.inc +++ b/core/modules/aggregator/aggregator.admin.inc @@ -6,7 +6,6 @@ */ use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Drupal\aggregator\Plugin\FetcherManager; use Drupal\aggregator\Plugin\Core\Entity\Feed; /** @@ -346,7 +345,7 @@ function aggregator_admin_form($form, $form_state) { aggregator_sanitize_configuration(); // Get all available fetchers. - $fetcher_manager = new FetcherManager(); + $fetcher_manager = drupal_container()->get('plugin.manager.aggregator.fetcher'); $fetchers = array(); foreach ($fetcher_manager->getDefinitions() as $id => $definition) { $label = $definition['title'] . ' ' . $definition['description'] . ''; diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 7298e4c..6e89fde 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -5,7 +5,6 @@ * Used to aggregate syndicated content (RSS, RDF, and Atom). */ -use Drupal\aggregator\Plugin\FetcherManager; use Drupal\aggregator\Plugin\Core\Entity\Feed; /** @@ -450,7 +449,7 @@ function aggregator_refresh(Feed $feed) { list($fetcher, $parser, $processors) = _aggregator_get_variables(); // Fetch the feed. - $fetcher_manager = new FetcherManager(); + $fetcher_manager = drupal_container()->get('plugin.manager.aggregator.fetcher'); try { $success = $fetcher_manager->createInstance($fetcher)->fetch($feed); } diff --git a/core/modules/block/lib/Drupal/block/Plugin/system/plugin_ui/BlockPluginUI.php b/core/modules/block/lib/Drupal/block/Plugin/system/plugin_ui/BlockPluginUI.php index 740b349..5beb482 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/system/plugin_ui/BlockPluginUI.php +++ b/core/modules/block/lib/Drupal/block/Plugin/system/plugin_ui/BlockPluginUI.php @@ -24,7 +24,7 @@ * "module" = @Translation("Modules") * }, * link_title = @Translation("Configure block"), - * manager = "Drupal\block\Plugin\Type\BlockManager", + * manager = "plugin.manager.block", * menu = TRUE, * path = "admin/structure/block/list", * suffix = "add", @@ -46,7 +46,8 @@ public function form($form, &$form_state, $facet = NULL) { // @todo Add an inline comment here. list($plugin, $theme) = explode(':', $this->getPluginId()); $plugin_definition = $this->getDefinition(); - $manager = new $plugin_definition['manager'](); + // @todo Find out how to let the manager be injected into the class. + $manager = drupal_container()->get($plugin_definition['manager']); $plugins = $manager->getDefinitions(); $form['#theme'] = 'system_plugin_ui_form'; $form['theme'] = array( diff --git a/core/modules/system/lib/Drupal/system/Plugin/PluginUIBase.php b/core/modules/system/lib/Drupal/system/Plugin/PluginUIBase.php index f2c312d..dd890fd 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/PluginUIBase.php +++ b/core/modules/system/lib/Drupal/system/Plugin/PluginUIBase.php @@ -22,7 +22,13 @@ */ public function form($form, &$form_state) { $plugin_definition = $this->getDefinition(); - $manager = new $plugin_definition['manager'](); + // @todo Find out how to let the manager be injected into the class. + if (class_exists($plugin_definition['manager'])) { + $manager = new $plugin_definition['manager'](); + } + else { + $manager = drupal_container()->get($plugin_definition['manager']); + } $plugins = $manager->getDefinitions(); $rows = array();