diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index e3f508f..2f25526 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -416,17 +416,6 @@ function aggregator_remove(Feed $feed) { } /** - * Gets the fetcher, parser, and processors. - * - * @return - * An array containing the fetcher, parser, and processors. - */ -function _aggregator_get_variables() { - $config = config('aggregator.settings'); - return array($config->get('fetcher'), $config->get('parser'), $config->get('processors')); -} - -/** * Checks a news feed for new items. * * @param \Drupal\aggregator\Plugin\Core\Entity\Feed $feed @@ -436,12 +425,11 @@ function aggregator_refresh(Feed $feed) { // Store feed URL to track changes. $feed_url = $feed->url->value; - list($fetcher, $parser, $processors) = _aggregator_get_variables(); - + $config = config('aggregator.settings'); // Fetch the feed. $fetcher_manager = drupal_container()->get('plugin.manager.aggregator.fetcher'); try { - $success = $fetcher_manager->createInstance($fetcher)->fetch($feed); + $success = $fetcher_manager->createInstance($config->get('fetcher'))->fetch($feed); } catch (PluginException $e) { $success = FALSE; @@ -451,7 +439,7 @@ function aggregator_refresh(Feed $feed) { $processor_manager = drupal_container()->get('plugin.manager.aggregator.processor'); // Store instances in an array so we dont have to instantiate new objects. $processor_instances = array(); - foreach ($processors as $processor) { + foreach ($config->get('processors') as $processor) { $processor_instances[$processor] = $processor_manager->createInstance($processor); } @@ -463,7 +451,7 @@ function aggregator_refresh(Feed $feed) { if ($success && ($feed->hash->value != $hash)) { // Parse the feed. $parser_manager = drupal_container()->get('plugin.manager.aggregator.parser'); - if ($parser_manager->createInstance($parser)->parse($feed)) { + if ($parser_manager->createInstance($config->get('parser'))->parse($feed)) { if (empty($feed->link->value)) { $feed->link->value = $feed->url->value; } diff --git a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php index a383925..fa99d47 100644 --- a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php +++ b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php @@ -28,6 +28,7 @@ class TestFetcher implements FetcherInterface { /** * Implements \Drupal\aggregator\Plugin\FetcherInterface::fetch(). + * * @todo Actually test this. */ public function fetch(Feed $feed) {} diff --git a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/parser/TestParser.php b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/parser/TestParser.php index beb5829..a01076f 100644 --- a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/parser/TestParser.php +++ b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/parser/TestParser.php @@ -27,6 +27,7 @@ class TestParser implements ParserInterface { /** * Implements \Drupal\aggregator\Plugin\ParserInterface::parse(). + * * @todo Actually test this. */ public function parse(Feed $feed) {} diff --git a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php index fc2e317..02c66ff 100644 --- a/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php +++ b/core/modules/aggregator/tests/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php @@ -62,18 +62,21 @@ public function settingsSubmit(array $form, array &$form_state) { /** * Implements \Drupal\aggregator\Plugin\ProcessorInterface::process(). + * * @todo Actually test this. */ public function process(Feed $feed) {} /** * Implements \Drupal\aggregator\Plugin\ProcessorInterface::remove(). + * * @todo Actually test this. */ public function remove(Feed $feed) {} /** * Implements \Drupal\aggregator\Plugin\ProcessorInterface::postProcess(). + * * @todo Actually test this. */ public function postProcess(Feed $feed) {}