Problem/Motivation
If the left_field
is a formula then the left_table
should be null. Here's the corresponsing fragment from the JoinPluginBase:
if ($this->leftTable) {
$left_table = $view_query->getTableInfo($this->leftTable);
$left_field = "$left_table[alias].$this->leftField";
}
else {
// This can be used if left_field is a formula or something. It should be used only *very* rarely.
$left_field = $this->leftField;
$left_table = NULL;
}
(source)
However, the ::buildExtra
method produces invalid sql in this case, e.g.
media__field_tags.langcode = .langcode
and that breaks the views query. Here's the code fragment responsible for this:
if (isset($info['left_field'])) {
$placeholder_sql = "$left[alias].$info[left_field]";
}
(source)
Proposed resolution
Add the left table alias to the query only if the left table is set. Additionally, allow setting the left_table directly in the extra definition in case the main join's left_field is a formula but the extra's left_field is, well, a field :).
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
Fixed a bug with formula handling in the extra conditions of a views join that caused problems when using the workspaces module.