diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index b2d0190..b1fcfe8 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -430,12 +430,12 @@ function comment_permalink(Comment $comment) { $page = comment_get_display_page($comment->id(), $node->type); // @todo: Cleaner sub request handling. - $request = drupal_container()->get('request'); + $request = \Drupal::service('request'); $subrequest = Request::create('/node/' . $node->nid, 'GET', $request->query->all(), $request->cookies->all(), array(), $request->server->all()); $subrequest->query->set('page', $page); // @todo: Convert the pager to use the request object. $_GET['page'] = $page; - return drupal_container()->get('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST); + return \Drupal::service('http_kernel')->handle($subrequest, HttpKernelInterface::SUB_REQUEST); } throw new NotFoundHttpException(); } diff --git a/core/modules/comment/comment.pages.inc b/core/modules/comment/comment.pages.inc index 5e1b190..ed1c27d 100644 --- a/core/modules/comment/comment.pages.inc +++ b/core/modules/comment/comment.pages.inc @@ -111,7 +111,7 @@ function comment_approve(Comment $comment) { // @todo CSRF tokens are validated in page callbacks rather than access // callbacks, because access callbacks are also invoked during menu link // generation. Add token support to routing: http://drupal.org/node/755584. - $token = drupal_container()->get('request')->query->get('token'); + $token = \Drupal::service('request')->query->get('token'); if (!isset($token) || !drupal_valid_token($token, 'comment/' . $comment->id() . '/approve')) { throw new AccessDeniedHttpException(); } diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc index ae0020a..0ac7535 100644 --- a/core/modules/comment/comment.views.inc +++ b/core/modules/comment/comment.views.inc @@ -360,7 +360,7 @@ function comment_views_data() { ), ); - if (drupal_container()->get('module_handler')->moduleExists('translation_entity')) { + if (\Drupal::moduleHandler()->moduleExists('translation_entity')) { $data['comment']['translation_link'] = array( 'title' => t('Translation link'), 'help' => t('Provide a link to the translations overview for comments.'), diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php index db5bba9..d0ce871 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NcsLastCommentName.php @@ -37,7 +37,7 @@ public function query() { ) ) ); - $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); + $join = \Drupal::service('plugin.manager.views.join')->createInstance('standard', $definition); // ncs_user alias so this can work with the sort handler, below. // $this->user_table = $this->query->add_relationship(NULL, $join, 'users', $this->relationship); diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php index 9e2c70e..89fe19b 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/sort/NcsLastCommentName.php @@ -28,7 +28,7 @@ public function query() { 'left_table' => $this->tableAlias, 'left_field' => 'last_comment_uid', ); - $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); + $join = \Drupal::service('plugin.manager.views.join')->createInstance('standard', $definition); // @todo this might be safer if we had an ensure_relationship rather than guessing // the table alias. Though if we did that we'd be guessing the relationship name