Add an option to use "strict fallback" mode by default in the EntityRepository::getTranslationFromContext() function

Created on 15 November 2023, 10 months ago

Problem/Motivation

In the issue 🐛 EntityRepository::getTranslationFromContext() function forcibly adds default entity language to fallback candidates Needs review we implemented a "strict fallback" mode, where the EntityRepository::getTranslationFromContext() can return NULL if no allowed fallbacks are available, instead of always returning the default translation for this case.

So, this strict way is more correct, than the current one.

But enabling this "strict fallback" mode by default will be a breaking change, that can break logic on the current sites, that expect always to receive a translation.

Steps to reproduce

1. Enable "strict mode" by default in Drupal.
2. Expect a lot of issues like "My site is broken, please revert the change!".

Proposed resolution

The proposed solution is to implement a configuration option "Use strict fallback mode by default" that will control the default behavior of this function.

It will give the ability to use this feature on sites, that are ready for this change, with not breaking sites, that are not yet ready for this.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component
Language system 

Last updated 1 day ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇦🇲Armenia Murz Yerevan, Armenia

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

Comments & Activities

Production build 0.71.5 2024