diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install index 488e7e9..60a09be 100644 --- a/core/modules/forum/forum.install +++ b/core/modules/forum/forum.install @@ -133,7 +133,7 @@ function forum_uninstall() { $field->delete(); } - if ($field = field_info_field('forum_container')) { + if ($field = entity_load('field_entity', 'forum_container')) { $field->delete(); } diff --git a/core/modules/forum/forum.routing.yml b/core/modules/forum/forum.routing.yml index 9a89a34..954e04a 100644 --- a/core/modules/forum/forum.routing.yml +++ b/core/modules/forum/forum.routing.yml @@ -32,21 +32,18 @@ forum_add_container: _content: 'Drupal\forum\Controller\ForumController::addContainer' requirements: _permission: 'administer forums' - forum_add_forum: pattern: 'admin/structure/forum/add/forum' defaults: _content: 'Drupal\forum\Controller\ForumController::addForum' requirements: _permission: 'administer forums' - forum_edit_container: pattern: 'admin/structure/forum/edit/container/{taxonomy_term}' defaults: _entity_form: 'taxonomy_term.container' requirements: _permission: 'administer forums' - forum_edit_forum: pattern: 'admin/structure/forum/edit/forum/{taxonomy_term}' defaults: diff --git a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php index 6d68a01..c5450f0 100644 --- a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php +++ b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php @@ -139,15 +139,16 @@ public function forumPage(TermInterface $taxonomy_term) { public function forumIndex() { $vocabulary = $this->vocabularyStorageController->load($this->config->get('vocabulary')); $index = $this->forumManager->getIndex(); + $build = $this->build($index->forums, $index); if (empty($index->forums)) { // Root of empty forum. - drupal_set_title($this->translationManager->translate('No forums defined')); + $build['#title'] = $this->translationManager->translate('No forums defined'); } else { // Set the page title to forum's vocabulary name. - drupal_set_title($vocabulary->label()); + $build['#title'] = $vocabulary->label(); } - return $this->build($index->forums, $index); + return $build; } /** diff --git a/core/modules/forum/lib/Drupal/forum/ForumManager.php b/core/modules/forum/lib/Drupal/forum/ForumManager.php index 8ab1b51..81a631a 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManager.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php @@ -10,7 +10,7 @@ use Drupal\Core\Config\ConfigFactory; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityManager; -use Drupal\Core\StringTranslation\TranslationManager; +use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\field\FieldInfo; use Drupal\node\NodeInterface; @@ -105,7 +105,7 @@ class ForumManager implements ForumManagerInterface { /** * Translation manager service. * - * @var \Drupal\Core\StringTranslation\TranslationManager + * @var \Drupal\Core\StringTranslation\TranslationInterface */ protected $translationManager; @@ -120,10 +120,10 @@ class ForumManager implements ForumManagerInterface { * The current database connection. * @param \Drupal\field\FieldInfo $field_info * The field info service. - * @param \Drupal\Core\StringTranslation\TranslationManager $translation_manager + * @param \Drupal\Core\StringTranslation\TranslationInterface $translation_manager * The translation manager service. */ - public function __construct(ConfigFactory $config_factory, EntityManager $entity_manager, Connection $connection, FieldInfo $field_info, TranslationManager $translation_manager) { + public function __construct(ConfigFactory $config_factory, EntityManager $entity_manager, Connection $connection, FieldInfo $field_info, TranslationInterface $translation_manager) { $this->configFactory = $config_factory; $this->entityManager = $entity_manager; $this->connection = $connection; diff --git a/core/modules/forum/lib/Drupal/forum/ForumManagerInterface.php b/core/modules/forum/lib/Drupal/forum/ForumManagerInterface.php index 6e54e0e..6072d87 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManagerInterface.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManagerInterface.php @@ -43,7 +43,7 @@ public function getChildren($vid, $tid); * * The forum index is a psuedo term that provides an overview of all forums. * - * @return \Drupal\taxonomy\Plugin\Core\Entity\Term + * @return \Drupal\taxonomy\TermInterface * A psuedo term representing the overview of all forums. */ public function getIndex(); @@ -83,9 +83,9 @@ public function checkNodeType(NodeInterface $node); * * Nodes are new if they are newer than HISTORY_READ_LIMIT. * - * @param integer $term + * @param int $term * The term ID of the forum. - * @param integer $uid + * @param int $uid * The user ID. * * @return @@ -96,7 +96,7 @@ public function unreadTopics($term, $uid); /** * Updates the taxonomy index for a given node. * - * @param integer $nid + * @param int $nid * The ID of the node to update. */ public function updateIndex($nid); diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ForumUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ForumUpgradePathTest.php index 1c936d5..e1a50e4 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ForumUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ForumUpgradePathTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\system\Tests\Upgrade\ForumUpgradePathTest. + * Contains \Drupal\system\Tests\Upgrade\ForumUpgradePathTest. */ namespace Drupal\system\Tests\Upgrade;