diff --git a/core/modules/forum/lib/Drupal/forum/Form/Overview.php b/core/modules/forum/lib/Drupal/forum/Form/Overview.php index e9d2b66..12361f2 100644 --- a/core/modules/forum/lib/Drupal/forum/Form/Overview.php +++ b/core/modules/forum/lib/Drupal/forum/Form/Overview.php @@ -18,11 +18,11 @@ class Overview extends OverviewTerms { /** - * Config object for forum.settings. + * Entity manager Service Object. * - * @var \Drupal\Core\Config\Config + * @var \Drupal\Core\Entity\EntityManager */ - protected $forumConfig; + protected $entityManager; /** * The url generator. @@ -41,7 +41,6 @@ class Overview extends OverviewTerms { */ public function __construct(ConfigFactory $config_factory, EntityManager $entity_manager, ModuleHandlerInterface $module_handler, UrlGeneratorInterface $url_generator) { parent::__construct($config_factory, $module_handler); - $this->forumConfig = $config_factory->get('forum.settings'); $this->entityManager = $entity_manager; $this->urlGenerator = $url_generator; } @@ -69,7 +68,8 @@ public function getFormID() { * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { - $vid = $this->forumConfig->get('vocabulary'); + $forum_config = $this->ConfigFactory->get('forum.settings'); + $vid = $forum_config->get('vocabulary'); $vocabulary = $this->entityManager->getStorageController('taxonomy_vocabulary')->load($vid); if (!$vocabulary) { throw new NotFoundHttpException(); @@ -78,13 +78,13 @@ public function buildForm(array $form, array &$form_state) { // Build base taxonomy term overview. $form = parent::buildForm($form, $form_state, $vocabulary); - $containers = $this->forumConfig->get('containers'); + $containers = $forum_config->get('containers'); foreach (element_children($form) as $key) { if (isset($form['terms'][$key]['#term'])) { $term = $form['terms'][$key]['#term']; $form['terms'][$key]['term']['#href'] = 'forum/' . $term->id(); unset($form['terms'][$key]['operations']['#links']['delete']); - if (in_array($form['terms'][$key]['#term']->id(), $this->forumConfig->get('containers'))) { + if (in_array($form['terms'][$key]['#term']->id(), $forum_config->get('containers'))) { $form['terms'][$key]['operations']['#links']['edit']['title'] = $this->t('edit container'); $form['terms'][$key]['operations']['#links']['edit']['href'] = 'admin/structure/forum/edit/container/' . $term->id(); // We don't want the redirect from the link so we can redirect the diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php index d79af40..f885f52 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/OverviewTerms.php @@ -41,7 +41,7 @@ class OverviewTerms extends FormBase { * The module handler service. */ public function __construct(ConfigFactory $config_factory, ModuleHandlerInterface $module_handler) { - $this->config = $config_factory->get('taxonomy.settings'); + $this->configFactory = $config_factory; $this->moduleHandler = $module_handler; } @@ -87,7 +87,7 @@ public function buildForm(array $form, array &$form_state, VocabularyInterface $ $page = $this->getRequest()->query->get('page') ?: 0; // Number of terms per page. - $page_increment = $this->config->get('terms_per_page_admin'); + $page_increment = $this->configFactory->get('taxonomy.settings')->get('terms_per_page_admin'); // Elements shown on this page. $page_entries = 0; // Elements at the root level before this page.