Fixed
Project:
Simple hierarchical select
Version:
2.0.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Nov 2017 at 11:55 UTC
Updated:
25 Jul 2026 at 08:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
aby v a commentedComment #3
igalafate commentedAs long as I can see this issue was not fixed in D7 (https://www.drupal.org/project/shs/issues/2725295) either. I have been debugging it and we always get the default language in the ajax controller function because is not set in the baseUrl in the ajax call. So I suggest to change the baseUrl from "/shs-term-data" to "/{current_langcode}/shs-term-data" where {current_langcode} is the current langcode.
I am not really sure if this is the correct place to set the language, any suggestion?
Comment #4
gugalamaciek commentedConsider scenario:
1. Open node page using shs. Terms are cached based on interface langauge (e.g. langA)
2. Open translations form. Data is get based on interface language (in most cases the same as in point 1.). So you create translation to langB, but you see term labels in langA.
What can be done is to change caching strategy from interface to content. So change this:
$this->contexts = ['languages:language_interface', 'user.roles'];into this:
$this->contexts = array_merge(['languages:' . LanguageInterface::TYPE_CONTENT, 'user.roles']);Terms are content, not interface. They should take into account content langauge, not interface langauge.
Proposed patch provides this change.
Comment #5
gugalamaciek commentedComment #6
joseph.olstadThis patch still applies cleanly to 2.0.x
With that said, does this patch work with AND without translation?
Comment #8
gugalamaciek commentedI prepared MR for 3.0.x which adds tests as well.
Comment #11
joseph.olstadComment #13
joseph.olstadReleases:
https://www.drupal.org/project/shs/releases/3.0.0-beta6%20
https://www.drupal.org/project/shs/releases/2.0.6