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..9481fa1 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 @@ -40,7 +40,7 @@ public function query() { $join = drupal_container()->get('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); +// $this->user_table = $this->query->addRelationship(NULL, $join, 'users', $this->relationship); $this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join); $this->field_alias = $this->query->add_field(NULL, "COALESCE($this->user_table.name, $this->tableAlias.$this->field)", $this->tableAlias . '_' . $this->field); 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..c9e6e22 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 @@ -33,7 +33,7 @@ public function query() { // @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 // so that doesn't matter that much. -// $this->user_table = $this->query->add_relationship(NULL, $join, 'users', $this->relationship); +// $this->user_table = $this->query->addRelationship(NULL, $join, 'users', $this->relationship); $this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join); $this->user_field = $this->query->add_field($this->user_table, 'name'); diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/relationship/EntityReverse.php b/core/modules/field/lib/Drupal/field/Plugin/views/relationship/EntityReverse.php index 6ae2118..f7ed001 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/relationship/EntityReverse.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/relationship/EntityReverse.php @@ -93,7 +93,7 @@ public function query() { // use a short alias for this: $alias = $this->definition['field_name'] . '_' . $this->table; - $this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship); + $this->alias = $this->query->addRelationship($alias, $second_join, $this->definition['base'], $this->relationship); } } 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 0f4f4b5..8dc5ea2 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 @@ -66,7 +66,7 @@ public function query($group_by = FALSE) { 'left_field' => 'word', ); $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); - $search_total = $this->query->add_relationship('search_total', $join, $search_index); + $search_total = $this->query->addRelationship('search_total', $join, $search_index); $this->search_score = $this->query->add_field('', "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 afb7724..5b7017a 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 @@ -147,7 +147,7 @@ public function query() { ); $join = drupal_container()->get('plugin.manager.views.join')->createInstance('standard', $definition); - $search_total = $this->query->add_relationship('search_total', $join, $search_index); + $search_total = $this->query->addRelationship('search_total', $join, $search_index); $this->search_score = $this->query->add_field('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE)); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/relationship/NodeTermData.php index f365c3a..865d379 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/relationship/NodeTermData.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/relationship/NodeTermData.php @@ -100,7 +100,7 @@ public function query() { // use a short alias for this: $alias = $def['table'] . '_' . $this->table; - $this->alias = $this->query->add_relationship($alias, $join, 'taxonomy_term_data', $this->relationship); + $this->alias = $this->query->addRelationship($alias, $join, 'taxonomy_term_data', $this->relationship); } } diff --git a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php index 1209901..b6c3593 100644 --- a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php +++ b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php @@ -93,7 +93,7 @@ function add_table($join = NULL, $alias = NULL) { } // If we found that there are tables in between, add the relationship. if ($r_join->table != $join->table) { - $relationship = $this->handler->query->add_relationship($this->handler->table . '_' . $r_join->table, $r_join, $r_join->table, $this->handler->relationship); + $relationship = $this->handler->query->addRelationship($this->handler->table . '_' . $r_join->table, $r_join, $r_join->table, $this->handler->relationship); } // And now add our table, using the new relationship if one was used. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php index 3f7c8bd..60701cc 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php @@ -290,7 +290,7 @@ public function submitOptionsForm(&$form, &$form_state) { * might have a relationship to an 'album' node, which might * have a relationship to an 'artist' node. */ - function add_relationship($alias, JoinPluginBase $join, $base, $link_point = NULL) { + public function addRelationship($alias, JoinPluginBase $join, $base, $link_point = NULL) { if (empty($link_point)) { $link_point = $this->view->storage->get('base_table'); } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php index b5c236d..f273e09 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/GroupwiseMax.php @@ -383,7 +383,7 @@ public function query() { // use a short alias for this: $alias = $def['table'] . '_' . $this->table; - $this->alias = $this->query->add_relationship($alias, $join, $this->definition['base'], $this->relationship); + $this->alias = $this->query->addRelationship($alias, $join, $this->definition['base'], $this->relationship); } } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php index 7041205..c218983 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/relationship/RelationshipPluginBase.php @@ -135,7 +135,7 @@ public function query() { // use a short alias for this: $alias = $def['table'] . '_' . $this->table; - $this->alias = $this->query->add_relationship($alias, $join, $this->definition['base'], $this->relationship); + $this->alias = $this->query->addRelationship($alias, $join, $this->definition['base'], $this->relationship); // Add access tags if the base table provide it. if (empty($this->query->options['disable_sql_rewrite']) && isset($table_data['table']['base']['access query tag'])) {