Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Taxonomy Term that were created through Taxonomy_Manager/voc/XYZ can't be translated even when Taxonomy Term XYZ has "Enabled translation"
Comment | File | Size | Author |
---|---|---|---|
#12 | taxonomy_manager-translate_terms-2662060-12.patch | 1.92 KB | cosolom |
Comments
Comment #2
tklepsch CreditAttribution: tklepsch commentedI had a similar issue and was able to fix the bug by removing the langcode as a value when the term is created. I have attached a patch with the fix.
Comment #3
JacobSanfordI'm not entirely convinced removing this is the correct solution. From the language() getter method on Entities, LanguageInterface::LANGCODE_NOT_SPECIFIED is what gets returned if no language was stored with the entity on creation. IMHO, this is correct unless we make assumptions that the 'default' language is the one we should associate with new items. And I'd need a lot of convincing there.
As this issue is quite old, I'm going to test if this issue still applies. Hopefully it doesn't and we can close!
Comment #4
JacobSanfordIt looks like translations are working as expected. I'm going to close this and consider it as a legacy issue related to a changing codebase.
Please do open again if you can reproduce!
Comment #5
joel_osc CreditAttribution: joel_osc at OpenPlus commentedI am still seeing this issue... here is a first attempt at a patch that uses the language configuration for the vocabulary to determine the default term language. There is likely method that exists that handles the code in my conditional logic but I could not seem to find it - at least this patch will help people for now. Thanks for your great work maintaining this module!
Comment #6
sashken2 CreditAttribution: sashken2 commentedPatch #5 works for me, but I change this line in patch:
'langcode' => $lang_code,
to:
'langcode' => $langcode,
Comment #7
joel_osc CreditAttribution: joel_osc at OpenPlus commentedOoops, will need to re-roll thx.
Comment #8
joel_osc CreditAttribution: joel_osc at OpenPlus commentedRe-roll with fix from @sashken2!
Comment #9
devad CreditAttribution: devad as a volunteer commentedThank you!
Patch "8 applies cleanly to alpha2 and in my case fixed issue as expected.
I didn't test it in details, but new bulk-added terms have properly assigned language now.
Before patching new added terms all had language "Not specified" value regardless of Vocabulary translation settings.
New version release would be great after this patch is hopefully committed soon. Translation support is such an essential feature.
RTBC
Comment #10
devad CreditAttribution: devad as a volunteer commentedComment #11
joel_osc CreditAttribution: joel_osc at OpenPlus commentedFixing a line of code from debugging that snuck through.
Comment #12
cosolom CreditAttribution: cosolom commentedRerolled for 2.0
Comment #13
VladimirAusComment #14
VladimirAusComment #16
VladimirAusThanks everyone for contributing, testing and reviewing!