Adding taxonomy_term translation doesn't invalidate corresponding caches

Created on 24 January 2024, 11 months ago
Updated 22 March 2024, 9 months ago

Problem/Motivation

When I add a translation to a taxonomy_term, the translation should be showed in front without having to cache-rebuild

Steps to reproduce

  1. Display a list of taxonomy terms in original language
  2. Translate one of the taxonomy terms
  3. Reload the page displaying the terms

In my case, I am using this type of code:

    $jobTitleOptions = [];
    foreach ($this->taxonomyTermStorage->loadByProperties(['vid' => 'job_title']) as $jobTitle) {
      $jobTitle = $this->entityRepository->getTranslationFromContext($jobTitle, $this->currentLangcode);
      $jobTitleOptions[$jobTitle->id()] = $jobTitle->getName();
    }

On page reload, the translation doesn't appear.
If I cache-rebuild, the translation appears

Proposed resolution

When adding a translation, the corresponding caches should be invalidated

🐛 Bug report
Status

Postponed: needs info

Version

11.0 🔥

Component
Taxonomy 

Last updated 1 day ago

  • Maintained by
  • 🇺🇸United States @xjm
  • 🇬🇧United Kingdom @catch
Created by

🇫🇷France louis-cuny

Live updates comments and jobs are added and updated live.
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.

  • Issue created by @louis-cuny
  • Status changed to Needs work 11 months ago
  • 🇮🇳India samit.310@gmail.com

    HI @louis-cuny,

    Looks like it is your custom code, Please add more detail here, also hope you are adding cache tags in your custom code to invalidate cache.

    Thanks
    Samit K.

  • Status changed to Postponed: needs info 9 months ago
  • 🇮🇳India mohit_aghera Rajkot

    @louis-cuny
    Marking this as postponed since it needs more information.
    Based on snippet given, it seems that cachable dependencies are not given.

    Feel free to reopen if you feel it is valid.

Production build 0.71.5 2024