Skip to content
Snippets Groups Projects
Commit a56065e3 authored by catch's avatar catch
Browse files

Issue #2011126 by kgoel, dcam: Replace drupal_container() with...

Issue #2011126 by kgoel, dcam: Replace drupal_container() with Drupal::service() in the search module.
parent 8a032aa7
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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));
......
......@@ -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);
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment