diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 19b0959..68fbb16 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -240,7 +240,6 @@ function aggregator_menu() { */ function _aggregator_category_title($category) { // @todo improve how the $category is handled (https://drupal.org/node/15266), should be an object already. - $category = aggregator_category_load($category); 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 2f00d77..a5e202f 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; @@ -86,6 +86,7 @@ public function __construct(EntityManager $entity_manager, Connection $database, */ public static function create(ContainerInterface $container) { return new static( + $container->get('plugin.manager.entity'), $container->get('database'), $container->get('config.factory'), $container->get('module_handler'), diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php index 11d5e35..9f14ee6 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/AggregatorCategoryForm.php @@ -11,6 +11,7 @@ use Drupal\Component\Utility\String; use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\Database\Connection; +use Drupal\Core\Entity\EntityManager; use Drupal\Core\Entity\EntityRenderControllerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormInterface; @@ -52,10 +53,8 @@ class AggregatorCategoryForm implements FormInterface, ControllerInterface { /** * Constructs a \Drupal\aggregator\Controller\AggregatorController object. * - * @param \Drupal\Core\Entity\EntityRenderControllerInterface $render_controler - * The Render controller. - * @param \Drupal\Core\Config\ConfigFactory $config_factory - * The config factory. + * @param \Drupal\Core\Entity\EntityManager $entity_manager + * The entity manager. * @param \Drupal\Core\Database\Connection $database * The database connection. * @param \Drupal\Core\Config\ConfigFactory $config_factory @@ -63,8 +62,8 @@ class AggregatorCategoryForm implements FormInterface, ControllerInterface { * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. */ - public function __construct(EntityRenderControllerInterface $render_controller, Connection $database, ConfigFactory $config_factory, ModuleHandlerInterface $module_handler) { - $this->renderController = $render_controller; + public function __construct(EntityManager $entity_manager, Connection $database, ConfigFactory $config_factory, ModuleHandlerInterface $module_handler) { + $this->renderController = $entity_manager->getRenderController('aggregator_item'); $this->database = $database; $this->configFactory = $config_factory; $this->moduleHandler = $module_handler; @@ -75,8 +74,7 @@ public function __construct(EntityRenderControllerInterface $render_controller, */ public static function create(ContainerInterface $container) { return new static( - // $container->get('plugin.manager.entity'), - $container->get('plugin.manager.entity')->getRenderController('aggregator_item'), + $container->get('plugin.manager.entity'), $container->get('database'), $container->get('config.factory'), $container->get('module_handler') @@ -112,7 +110,7 @@ public function buildForm(array $form, array &$form_state, $category = NULL) { '#type' => 'table', '#header' => array('', t('Categorize')), ); - if ($items && ($form_items = $this->renderController->getRenderController('aggregator_item')->viewMultiple($items, 'default'))) { + if ($items && ($form_items = $this->renderController->viewMultiple($items, 'default'))) { foreach (element_children($form_items) as $iid) { $categories_result = $this->database->query('SELECT c.cid, c.title, ci.iid FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid AND ci.iid = :iid', array(':iid' => $iid)); @@ -145,7 +143,8 @@ public function buildForm(array $form, array &$form_state, $category = NULL) { ); $form['pager'] = array('#theme' => 'pager'); - return $form; } + return $form; + } /** * {@inheritdoc}