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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

das-peter created an issue. See original summary.

  • markcarver committed 08cab36 on 7.x-2.x authored by das-peter
    Issue #2984092 by das-peter: js_callback_bootstrap() can reset auto-...
markhalliwell’s picture

Status: Needs review » Fixed

Thanks! Sorry it took so long.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.