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.
Problem/Motivation
If the callback definition provides the lang
key the value of this is used as language due to this construct:
// If language is enabled and site is multilingual, bootstrap at least to
// DRUPAL_BOOTSTRAP_LANGUAGE and ensure the required modules are enabled.
if (isset($info['lang'])) {
$_js['lang'] = $info['lang'];
}
As of then $_js['lang']
might already contain an auto-detected language - see js_execute_request()
When reseting the language the default language will kick in as js_update_path()
will set a wrong path prefix and hence the language detection won't work properly.
Proposed resolution
Don't copy the value to $_js['lang']
but rather use it for the condition in js_callback_bootstrap()
.
Remaining tasks
Reviews needed.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
js-js_callback_bootstrap-resets-detected-language.patch | 889 bytes | das-peter |
Comments
Comment #3
markhalliwellThanks! Sorry it took so long.