If I translate users, article show up $userTranslations times in content list

Created on 13 February 2024, 4 months ago
Updated 23 March 2024, 3 months ago

Problem/Motivation

I want to translate my users to have translated bio for the site.

But when I do this, every article with an author that is translated is displayed multiple times in the content list - since we have 5 languages active this is very annoying.

Steps to reproduce

Install tmgmt, activate a few languages, translate users, set one of these user as author of a page and see the page displayed X times in the content list, X being the number of translations of the user..

Proposed resolution

Somehow convince the content view not to select the users_field_data.langcode - why would it?

I tried to delete the existing relation in the view, but whenever I add a relation to user, the langcode is selected. It really is not needed here, so I do not get why drupal is adding it...


The views sql showing the authorslangcode used

SELECT "node_field_data"."langcode" AS "node_field_data_langcode", "users_field_data_node_field_data"."langcode" AS "users_field_data_node_field_data_langcode", "node_field_data"."nid" AS "nid", "users_field_data_node_field_data"."uid" AS "users_field_data_node_field_data_uid", 'content:default' AS "view_name"
FROM
node_field_data "node_field_data"
INNER JOIN users_field_data "users_field_data_node_field_data" ON node_field_data.uid = users_field_data_node_field_data.uid
WHERE (node_field_data.status = 1 OR (node_field_data.uid = 2 AND 2 <> 0 AND 1 = 1) OR 1 = 1 OR 1 = 1)
ORDER BY "node_field_data"."changed" DESC NULLS LAST
LIMIT 10
πŸ’¬ Support request
Status

Fixed

Version

1.15

Component

Core

Created by

πŸ‡©πŸ‡ͺGermany mathiasp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mathiasp
  • Status changed to Fixed 3 months ago
  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    That's not our view, this would also happen if you manually do the translation.

    You need to add a condition on user default translation being true. There is a core issue to improve the default behavior.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024