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.
If you have translated vocabulary (via translation sets) with terms hierarchy and try to edit term on language different from current site language, you'll see what "Relations" form part (where HS control appear) doesn't fill with parent terms.
I have patches for this problem, see attach.
Comment | File | Size | Author |
---|---|---|---|
#17 | hs_taxonomy_wrong_relations-2636804-17.patch | 1.39 KB | skylord |
#12 | hs_taxonomy_wrong_relations-2636804-12.patch | 1.39 KB | skylord |
#3 | hs_correctly_translate_terms-2636804-3.patch | 4.52 KB | skylord |
hierarchical_select_3.patch | 4.42 KB | Andrew Answer | |
hierarchical_select_2.patch | 439 bytes | Andrew Answer | |
Comments
Comment #2
Andrew Answer CreditAttribution: Andrew Answer commentedComment #3
skylord CreditAttribution: skylord commentedSuffered from the same issue - thanks for patch, it works OK! Recreated it for easy using.
Comment #4
skylord CreditAttribution: skylord commentedComment #5
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #7
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedThanks guys.
Comment #8
m.lebedev CreditAttribution: m.lebedev commentedI have problems with the hierarchy of terms after applied the patch. When I edit a term the field of Relations shows empty sections on the taxonomy term form.
I found that terms disappear after execute this code:
$excluded_term->language
The term may include a language that is different from other terms. After that, other terms will not be translated correctly. The items will be empty.
I think that translation of terms should be located in function _hs_taxonomy_hierarchical_select_terms_to_options and it is on there already.
I also checked that there is no such problem in the green version of the module.
My tests:
Term 1 (und)
->Term 2 (en)
->Term 3 (other)
Term 1 (other)
->Term 2 (und)
->Term 3 (en)
and etc.
Are you sure that the problem existed before applying the patch?
Comment #9
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedHello, thank you for noticing I will recheck it.
Comment #10
skylord CreditAttribution: skylord commentedOf course!
I can't fully understand your case. In my case i have taxonomy vocabulary in two languages (no language neutral items) - English and Russian. When i try to edit any english term while site interface is switched to russian - i get an error mentioned in first post. Patch solves it for me.
Comment #11
m.lebedev CreditAttribution: m.lebedev commentedИзвиняюсь за русский.
Предлагаю починить совместными усилиями.
Запустил дев версию модуля на своем проекте и получил ровно то, с чем борется этот патч.
Откатил на зеленую версию и пытался воспроизвести данную ошибку, путем смены языка терминов. Ошибок не обнаружил.
После посмотрел строчку:
Поставил модуль title, повторил тесты. Снова не удалось.
Есть ли кейс чтобы воспроизвести ошибку?
Comment #12
skylord CreditAttribution: skylord commentedНу можно и на русском... Исходная проблема: при редактировании термина таксономии на языке, не совпадающем с текущим языком интерфейса - криво отображается иерархия. До этого в патч исходного автора не вглядывался, просто применил и оно, вроде, заработало. Сейчас попробовал - действительно, глючит. Изучил патч - его мысль понятная, но много каких-то непонятных и non-drupal-way телодвижений. :-) Суть в том, что при наличии активного модуля i18n_select, переписываются все запросы к БД с добавлением фильтра на текущий язык - поэтому и глючит, если текущий язык не совпадает с языком термина. Ниже приложен патч, который эту проблему решает более просто и наглядно (отключает i18n_select перед запросом родительских и дочерних терминов). Попробуйте, плз. Ранее опубликованный патч предлагаю откатить, т.к. подтверждаю его глючность.
Comment #14
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedЯ откатил патч, @m.lebedev можешь проверить что сейчас ок?
И давайте дальше на англ. продолжать, чтобы не только нам понятно было.
Comment #15
m.lebedev CreditAttribution: m.lebedev commentedokay!
I will do it as it will be time. Thanks.
Comment #16
m.lebedev CreditAttribution: m.lebedev commentedYes. The patch works.
Comment #17
skylord CreditAttribution: skylord commentedRerolled for last release.
Comment #18
GoldLooks good. Just needs Code Standards applied. There's no expectation that the whole file will be brought up to standards but the code the patch adds/touches should, at a minimum, not introduce more non-standards compliant code.