Multilingual views hide if no translation My Drupal website has 2 languages and I created blog view that lists articles (content type). Default language is English.

Problem is that some articles are only in German and then on my English view I get German articles.

I tried adding Content: Translation language Filter that I set to Interface text language selected for page but then on German page I only get articles that were created on German and the ones that were created in English but have German translation are missing.

Query :

SELECT node_field_data.created AS node_field_data_created, 
node_field_data.nid AS nid
FROM 
{node_field_data} node_field_data
LEFT JOIN {node__field_content_type} node__field_content_type ON 
node_field_data.nid = node__field_content_type.entity_id AND 
(node__field_content_type.deleted = '0' AND 
node__field_content_type.langcode = node_field_data.langcode)
WHERE (( (node_field_data.status = '1') AND (node_field_data.type IN  
('article')) AND (node__field_content_type.field_content_type_value = '1') 
))
ORDER BY node_field_data_created DESC
LIMIT 5 OFFSET 0


Query with Translation language filter:

SELECT node_field_data.created AS node_field_data_created, 
node_field_data.nid AS nid
FROM 
{node_field_data} node_field_data
LEFT JOIN {node__field_content_type} node__field_content_type ON 
node_field_data.nid = node__field_content_type.entity_id AND 
(node__field_content_type.deleted = '0' AND 
node__field_content_type.langcode = node_field_data.langcode)
LEFT JOIN {node__field_tags} node__field_tags ON node_field_data.nid = 
node__field_tags.entity_id AND node__field_tags.field_tags_target_id = '4'
WHERE (( (node__field_tags.field_tags_target_id IS NULL) )AND(( 
(node_field_data.status = '1') AND (node_field_data.type IN  ('article')) 
AND (node__field_content_type.field_content_type_value = '1') AND 
(node_field_data.langcode IN  ('en')) )))
ORDER BY node_field_data_created DESC
LIMIT 5 OFFSET 0


From queries, I see that LEFT JOIN is adding node__field_content_type.langcode = node_field_data.langcode and I think that is making problems when I add the language filter, any suggestion?
The problem was that I was doing condition in views with field that wasn't translatable and views are adding join on langcode, thanks to user 4k4 that linked to this issue that can be found here.

I fixed this by removing untranslated field from view and hooking into hook_views_query_alter and adding relationship myself :

&lt;?php

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

function hook_views_query_alter(ViewExecutable $view, 
QueryPluginBase $query)
{
    if ($view-&gt;id() == 'blog') {
        $definition = [
            'table' =&gt; 'node__field_content_type',
            'field' =&gt; 'entity_id',
            'left_table' =&gt; 'node_field_data',
            'left_field' =&gt; 'nid',
        ];
        $join = Drupal::service('plugin.manager.views.join')-&gt;createInstance('standard', $definition);
        $query-&gt;addRelationship('node__field_content_type', $join, 'node__field_content_type');
        $query-&gt;addWhere('1', 'node__field_content_type.field_content_type_value', 1, '=');
    }
}


Also this hook has to be in MODULE.views_execution.inc file