diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 0f076c4..11d265b 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -159,7 +159,7 @@ function forum_menu() { * Implements hook_menu_local_tasks(). */ function forum_menu_local_tasks(&$data, $router_item, $root_path) { - global $user; + $user = Drupal::currentUser(); // Add action link to 'node/add/forum' on 'forum' sub-pages. if ($root_path == 'forum' || $root_path == 'forum/%') { @@ -690,7 +690,7 @@ function template_preprocess_forums(&$variables) { * - tid: Taxonomy term ID of the current forum. */ function template_preprocess_forum_list(&$variables) { - global $user; + $user = Drupal::currentUser(); $row = 0; // Sanitize each forum so that the template can safely print the data. foreach ($variables['forums'] as $id => $forum) { diff --git a/core/modules/forum/lib/Drupal/forum/ForumManager.php b/core/modules/forum/lib/Drupal/forum/ForumManager.php index 0f03e63..0e83adf 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumManager.php +++ b/core/modules/forum/lib/Drupal/forum/ForumManager.php @@ -139,7 +139,8 @@ public function getTopics($tid) { $forum_per_page = $config->get('topics.page_limit'); $sortby = $config->get('topics.order'); - global $user, $forum_topic_list_header; + global $forum_topic_list_header; + $user = $user = Drupal::currentUser(); $forum_topic_list_header = array( array('data' => $this->translationManager->translate('Topic'), 'field' => 'f.title'), @@ -326,7 +327,7 @@ protected function numberNew($nid, $timestamp) { * previously viewed the node; otherwise HISTORY_READ_LIMIT. */ protected function lastVisit($nid) { - global $user; + $user = Drupal::currentUser(); if (empty($this->history[$nid])) { $result = $this->connection->select('history', 'h')