How to modify an existing view join? 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-&gt;getJoinData("node__field_joined_whatever", "node_field_data");

//$joindata contains the join I need, so far so good

    foreach($joindata-&gt;extra as $ix=&gt;$val) {
      if (isset($val['field']) &amp;&amp; $val['field'] == 'langcode') {
        unset($joindata-&gt;extra[$ix]);
      }
    }
//here I have modified join object, but there is nothing like '$query-&gt;setJoinData()'
...
}


Does anybody know how to put my modified join back to the query?
Usually, you should control join type using views Advance relationship options. By enabling "Require this relationship" you are telling Views to use "INNER" Join instead of using "LEFT" Join. If this option is somehow not working here is how I would solve this problem.

use \Drupal\views\ViewExecutable;
use \Drupal\views\Plugin\views\query\QueryPluginBase;

function hook_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
   // check your view ID:
if ($view-&gt;id() === 'id') {
 //Get your table info object;
  $table = $query-&gt;getTableInfo('table');
if (isset($table['join']-&gt;type) &amp;&amp; $table['join']-&gt;type === "INNER") {
//Change your Join type;
 $table['join']-&gt;type = 'LEFT';
   }
 }
}