diff --git a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php index b3915282c9c..4c4d2ae6033 100644 --- a/core/modules/views/lib/Drupal/views/ManyToOneHelper.php +++ b/core/modules/views/lib/Drupal/views/ManyToOneHelper.php @@ -220,11 +220,11 @@ class ManyToOneHelper { } $this->handler->view->many_to_one_aliases[$field][$value] = $this->handler->table . '_value_' . ($this->handler->view->many_to_one_count[$this->handler->table]++); } - $alias = $this->handler->tableAliases[$value] = $this->addTable($join, $this->handler->view->many_to_one_aliases[$field][$value]); - // and set table_alias to the first of these. + $this->handler->tableAliases[$value] = $this->addTable($join, $this->handler->view->many_to_one_aliases[$field][$value]); + // Set tableAlias to the first of these. if (empty($this->handler->tableAlias)) { - $this->handler->tableAlias = $alias; + $this->handler->tableAlias = $this->handler->tableAliases[$value]; } } }