codebymikey → changed the visibility of the branch 3014694-avoid-duplicate-entry to hidden.
- Merge request !52Issue #3014694: Avoid duplicate entry for mass adding terms → (Open) created by codebymikey
- Status changed to RTBC
about 1 month ago 4:51pm 26 May 2025 - 🇺🇦Ukraine dburiak
The MR!52 is tested on Drupal 10.4.7.
The bunch of taxonomy terms is imported successfully without duplicates.
Works properly.Moving the ticket to RTBC.
- First commit to issue fork.
- 🇦🇺Australia jannakha Brisbane!
I have tested the patch and found an interesting issue, if vocabulary was setup with langcode (but module is not enabled - data and structure has been migrated from D8->D9->D10 and some stage language module might have been enabled) it will not match duplicates.
Maybe add additional langcode check:
// Check if site is multilingual. if ($this->moduleHandler->moduleExists('language')) { ... } else { $vocabulary = \Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')->load($vid); $langcode = $vocabulary->get('langcode'); }
- 🇦🇺Australia jannakha Brisbane!
so, I installed a brand new Drupal 11 site, created a couple of vocabs and taxonomy terms,
then installed taxonomy manager with patch (before langcode fix).Because by default (even without multi-lingual support) langcode is set to 'en' but taxonomy manager is searching for 'und'
so duplicates are added anyway:
After langcode set to 'en' - duplicates are not created (matched to langcode 'en').
There'll be an issue with all terms which were created with taxonomy_manager before this fix (as they are created with langcode 'und')