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?
(node_field_data.langcode IN ('en', 'en')) )))
, so by looking at the filter this means the interface language is detected as english.original language
when I add filterfield_content_type
in your node is not translatable, see this issue drupal.org/node/2451657node__field_content_type.langcode
has only original language whilenode_field_data.langcode
has all languages, that is why I thought that that will make a problem. Detection prntscr.com/f9k62p, will check that issue. Thank you