I am trying to modify an existing views join.
Let's say I am trying to remove the 'langcode' condition.
What I have so far:
function mymodule_views_query_alter(Drupal\views\ViewExecutable $view, Drupal\views\Plugin\views\query\Sql $query) {
$joindata = $query->getJoinData("node__field_joined_whatever", "node_field_data");
//$joindata contains the join I need, so far so good
foreach($joindata->extra as $ix=>$val) {
if (isset($val['field']) && $val['field'] == 'langcode') {
unset($joindata->extra[$ix]);
}
}
//here I have modified join object, but there is nothing like '$query->setJoinData()'
...
}
Does anybody know how to put my modified join back to the query?