diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 68fbb16..081768d 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -239,7 +239,6 @@ function aggregator_menu() { * A string with the aggregator category title. */ function _aggregator_category_title($category) { - // @todo improve how the $category is handled (https://drupal.org/node/15266), should be an object already. return $category->title; } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php b/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php index a69de16..a8b1d80 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php @@ -64,14 +64,14 @@ class AggregatorController implements ControllerInterface { * * @param \Drupal\Core\Entity\EntityManager $entity_manager * The Entity manager. + * @param \Drupal\Core\Config\ConfigFactory $config_factory + * The config factory. * @param \Drupal\Core\Database\Connection $database * The database connection. * @param \Drupal\Core\Config\ConfigFactory $config_factory * The config factory. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. - * @param \Drupal\Core\Routing\PathBasedGeneratorInterface $url_generator - * The url generator. */ public function __construct(EntityManager $entity_manager, Connection $database, ConfigFactory $config_factory, ModuleHandlerInterface $module_handler, PathBasedGeneratorInterface $url_generator) { $this->entityManager = $entity_manager; @@ -265,13 +265,13 @@ public function categories() { public function pageLast() { drupal_add_feed('aggregator/rss', $this->configFactory->get('system.site')->get('name') . ' ' . t('aggregator')); - // @todo Refactor this function once all controller conversions are done. + // @todo Refactor this function once after all controller conversions are + // done. $this->moduleHandler->loadInclude('aggregator', 'inc', 'aggregator.pages'); - // @todo Replace this with ItemStorageController::loadFeedItems() from - // https://drupal.org/node/2043581 when it is in. $items = aggregator_load_feed_items('sum'); - // @todo Refactor this function once all controller conversions are done. + // @todo Refactor this function once after all controller conversions are + // done. return _aggregator_page_list($items, arg(1)); } @@ -282,6 +282,7 @@ public function pageLast() { * A render array as expected by drupal_render(). */ public function sources() { + $feeds = $this->entityManager->getStorageController('aggregator_feed')->loadMultiple(); $build = array( @@ -321,4 +322,5 @@ public function sources() { ); return $build; } + } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php index c591b1f..7826384 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php @@ -8,7 +8,7 @@ namespace Drupal\aggregator\Form; use Drupal\Component\Utility\String; -use Drupal\Core\Config\ConfigFactory; +use Drupal\Core\Config\Config; use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityManager; @@ -57,15 +57,15 @@ class AggregatorCategoryForm implements FormInterface, ControllerInterface { * The item render controller. * @param \Drupal\Core\Database\Connection $database * The database connection. - * @param \Drupal\Core\Config\ConfigFactory $config_factory - * The config factory. + * @param \Drupal\Core\Config\Config $config + * The aggregator config. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. */ - public function __construct(EntityRenderControllerInterface $render_controller, Connection $database, ConfigFactory $config_factory, ModuleHandlerInterface $module_handler) { + public function __construct(EntityRenderControllerInterface $render_controller, Connection $database, Config $config, ModuleHandlerInterface $module_handler) { $this->renderController = $render_controller; $this->database = $database; - $this->config = $config_factory->get('aggregator.settings'); + $this->config = $config; $this->moduleHandler = $module_handler; } @@ -76,7 +76,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('plugin.manager.entity')->getRenderController('aggregator_item'), $container->get('database'), - $container->get('config.factory'), + $container->get('config.factory')->get('aggregator.settings'), $container->get('module_handler') ); } @@ -158,8 +158,11 @@ public function validateForm(array &$form, array &$form_state) { public function submitForm(array &$form, array &$form_state) { if (!empty($form_state['values']['categories'])) { foreach ($form_state['values']['categories'] as $iid => $selection) { - $this->database->delete('aggregator_category_item')->condition('iid', $iid)->execute(); - $insert = $this->database->insert('aggregator_category_item')->fields(array('iid', 'cid')); + $this->database->delete('aggregator_category_item') + ->condition('iid', $iid) + ->execute(); + $insert = $this->database->insert('aggregator_category_item') + ->fields(array('iid', 'cid')); $has_values = FALSE; foreach ($selection as $cid) { if ($cid && $iid) {