From a56065e31c634a5082fce4abeb3b6febd8867283 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Wed, 10 Jul 2013 22:45:58 +0100 Subject: [PATCH] Issue #2011126 by kgoel, dcam: Replace drupal_container() with Drupal::service() in the search module. --- .../search/lib/Drupal/search/Plugin/views/argument/Search.php | 2 +- .../search/lib/Drupal/search/Plugin/views/filter/Search.php | 2 +- core/modules/search/search.module | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php index 615953468d1f..96810a641e55 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php +++ b/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php @@ -65,7 +65,7 @@ public function query($group_by = FALSE) { 'left_table' => $search_index, 'left_field' => 'word', ); - $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); + $join = \Drupal::service()->get('plugin.manager.views.join')->createInstance('standard', $definition); $search_total = $this->query->addRelationship('search_total', $join, $search_index); $this->search_score = $this->query->addField('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE)); diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php index 6ca3089357db..7461bdd4e8a2 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php +++ b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php @@ -145,7 +145,7 @@ public function query() { 'left_table' => $search_index, 'left_field' => 'word', ); - $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); + $join = \Drupal::service()->get('plugin.manager.views.join')->createInstance('standard', $definition); $search_total = $this->query->addRelationship('search_total', $join, $search_index); diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 083fb0571bf4..fce46308f8f4 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -625,7 +625,7 @@ function search_index($sid, $module, $text, $langcode) { if ($tagname == 'a') { // Check if link points to a node on this site if (preg_match($node_regexp, $value, $match)) { - $path = drupal_container()->get('path.alias_manager')->getSystemPath($match[1]); + $path = Drupal::service('path.alias_manager')->getSystemPath($match[1]); if (preg_match('!(?:node|book)/(?:view/)?([0-9]+)!i', $path, $match)) { $linknid = $match[1]; if ($linknid > 0) { -- GitLab