Adding taxonomy_term translation doesn't invalidate corresponding caches

Created on 24 January 2024, over 1 year 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, even in development mode, 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

Active

Version

10.2

Component
Taxonomy 

Last updated 5 days 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

  • Issue created by @louis-cuny
  • Status changed to Needs work over 1 year 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 over 1 year 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.

  • Status changed to Closed: outdated 30 days ago
  • 🇺🇸United States smustgrave

    Since there's been no follow up going to close out. If still a bug in D11 please reopen.

Production build 0.71.5 2024