Taxonomy term Parent terms field displays the term names in original language

Created on 25 August 2021, about 3 years ago
Updated 29 January 2024, 10 months ago

Problem/Motivation

During the creation of taxonomy terms in a multilingual site, when you add new or edit existing terms, the Relationships/Parent Terms form displays the previously created terms in the original creation language rather than the current interface language.

Steps to reproduce

1. add at least 2 languages to the site (for example: English and Spanish)
2. enable translation and enable users to choose the original language for taxonomy vocabulary
3. create a term 1 in Spanish
4. translate that term 1 to English
5. create a term 2 in English
6. translate term 2 to Spanish
7. change the site language to English,
8. again open the form where you can add terms.

Expected result:
In the "Parent terms" field under RELATIONS, every term is listed in the current language (if you followed the steps, then in English).

Actual result:
In the "Parent terms" field under RELATIONS, every term is listed in their original language. Even if terms have translation in the current language.

Proposed resolution

Change the form preprocessing logic in accordance with the current interface language.

Remaining tasks

Update issue summary
review

User interface changes

Correct representation of form with current language.

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Taxonomyย  โ†’

Last updated about 10 hours ago

  • Maintained by
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States @xjm
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @catch
Created by

๐Ÿ‡ธ๐Ÿ‡ฐSlovakia kaszarobert

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • ๐Ÿ‡ท๐Ÿ‡บRussia DenisVS

    The same issue, Drupal 10.1.3
    Parent term names in original language.

  • Status changed to Needs review 11 months ago
  • Pipeline finished with Success
    11 months ago
    Total: 3011s
    #68667
  • Pipeline finished with Success
    11 months ago
    Total: 1182s
    #69035
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Kanchan Bhogade

    Hi,
    Tried to reproduce the issue using the given steps, but unable to reproduce it.
    Followed steps:
    1. add at least 2 languages to the site (for example: English and Spanish)
    2. enable translation and enable users to choose the original language for taxonomy vocabulary
    3. create a term 1 in Spanish
    4. translate that term 1 to English
    5. create a term 2 in English
    6. translate term 2 to Spanish
    7. change the site language to English,
    8. again open the form where you can add terms.

    Can you please share the reproducing steps in detail?

  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Issue summary has some sections that are missing.

    What's the solution, ui changes, api changes?

    Also will need a failing test case to show the problem.

  • ๐Ÿ‡ท๐Ÿ‡บRussia DenisVS
  • ๐Ÿ‡ท๐Ÿ‡บRussia DenisVS
  • ๐Ÿ‡ท๐Ÿ‡บRussia DenisVS
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    Prashant.c โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    11 months ago
    Total: 165s
    #69519
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    1. I successfully replicated the issue using the steps outlined in the "Steps to reproduce." In essence, the "Parent terms" section under "Relations" is displaying term names for all languages in the term list.
    2. The patch/MR addressing this problem ensures that only terms relevant to the respective language are listed in the "Parent terms" section.
    3. The code has been refactored and requires both code review and thorough testing, including manual and automated tests.

    Thank you.

  • Pipeline finished with Success
    11 months ago
    Total: 591s
    #69522
  • First commit to issue fork.
  • Pipeline finished with Failed
    11 months ago
    Total: 228s
    #69565
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arisen Goa

    Added the functional test case for parents translation under the TermTranslationTest Suite.

    1) Drupal\Tests\taxonomy\Functional\TermTranslationTest::testParentTermsTranslation
    Behat\Mink\Exception\ResponseTextException: The text "translatedOne" was not found anywhere in the text of the current page.
    
    /var/www/html/vendor/behat/mink/src/WebAssert.php:811
    /var/www/html/vendor/behat/mink/src/WebAssert.php:262
    /var/www/html/web/core/modules/taxonomy/tests/src/Functional/TermTranslationTest.php:134
    /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    
    ERRORS!
    Tests: 8, Assertions: 692, Errors: 1.
  • Pipeline finished with Failed
    10 months ago
    Total: 169s
    #79766
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arisen Goa

    Fixed the spellcheck issues in the test. But spellcheck now failing since I rebased.

  • Pipeline finished with Failed
    10 months ago
    Total: 798886s
    #79770
  • Pipeline finished with Success
    10 months ago
    Total: 673s
    #83986
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arisen Goa
Production build 0.71.5 2024