Content language negotiation not working for entity autocomplete

Created on 23 March 2017, over 7 years ago
Updated 21 December 2023, 11 months ago

Problem/Motivation

If a multilingual site is configured to use a content language negotiation through a query parameter then autocomplete post requests will not contain the query parameters from the current url and the returned entity labels will not be in the current content language in the case it doesn't matches the default language.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Language system 

Last updated about 3 hours ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇩🇪Germany Maouna

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India nikhil_110

    Attached patch against Drupal 10.1.x

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India TanujJain-TJ

    patch #25 doesn't apply on drupal 10.1.x and throws this error

    Checking patch core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php...
    error: while searching for:
        // url.
    
        // First, check if processing conditions are met.
        if (!($request && !empty($options['route']) && $this->hasLowerLanguageNegotiationWeight() && $this->meetsContentEntityRoutesCondition($options['route'], $request))) {
          return $path;
        }
    
    
    error: patch failed: core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php:105
    error: core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php: patch does not apply

    adding a new patch to fix CCF on #28, adding interdiff and reroll diff. please review

  • Status changed to Needs work over 1 year ago
  • 🇬🇧United Kingdom joachim

    NW for the test failure and also #24.

  • 🇳🇱Netherlands watergate

    The patch of #29 didn't apply to Drupal 10.2. So, I've updated the patch.

    I've removed the proposed changes in the FormElement class, as they have already been added to Drupal (10.2).

    The points made by #2863308-24: Content language negotiation not working for entity autocomplete must still be addressed.

Production build 0.71.5 2024