Problem/Motivation

Views that filter by language using the ***LANGUAGE_language_interface*** langcode filter correctly limit SQL results to the current language, but still render nodes in their default language. This affects nodes where the default language differs from the current interface language
(e.g., a node created in English with a German translation will render in English on the German site).

The root cause is that the rendering_language view display setting was not set, defaulting to ***LANGUAGE_entity_translation*** (the entity's own default language). This means the langcode filter does the right thing at the query level, but the row renderer still loads and
displays the entity's default translation.

Additionally, the cases view was missing the langcode filter entirely, so it showed all content regardless of language.

Steps to reproduce

  1. Enable the drupal_de config split (or any non-default language split)
  2. Create a node in English, then add a German translation
  3. Visit the news, events, or cases listing page in German
  4. Observe that nodes with English as default language render in English instead of German

Proposed resolution

  • Set rendering_language: '***LANGUAGE_language_interface***' on all displays of the news, events, and cases views
  • Add the missing langcode filter (***LANGUAGE_language_interface***) to all displays of the cases view

Remaining tasks

  • Review and merge the config changes
  • Verify on staging that all three views only show translated content in the correct language

User interface changes

None. Views will now correctly display only content in the current interface language.

API changes

None.

Data model changes

None. Only view configuration is updated.

Issue fork la_eu-3582269

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

stmh created an issue. See original summary.

evilargest changed the visibility of the branch 3582269-duplicate-content-in to hidden.

evilargest changed the visibility of the branch 3582269-duplicate-content-in to active.

evilargest’s picture

Status: Active » Reviewed & tested by the community

The changes look good to me. I tested all view blocks/sliders/listings for news, events, cases, partners, and categories, and all of those are language aware. Moving to RTBC

  • taran2l committed 68f645e7 on staging authored by stmh
    feat: #3582269 Duplicate content in views
    
    By: stmh
    By: evilargest
    
taran2l’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • taran2l committed 68f645e7 on 1.0.x authored by stmh
    feat: #3582269 Duplicate content in views
    
    By: stmh
    By: evilargest
    

  • taran2l committed 68f645e7 on downstream/la_nl authored by stmh
    feat: #3582269 Duplicate content in views
    
    By: stmh
    By: evilargest