Skip to content
Snippets Groups Projects
Commit 99aa2d67 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2474537 by Noe_, tstoeckler, michaellenahan, cilefen: Installing in a...

Issue #2474537 by Noe_, tstoeckler, michaellenahan, cilefen: Installing in a non-English language fails for command-line installations (Drush, ...)
parent 4d4635c1
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -1045,7 +1045,7 @@ function drupal_check_module($module) {
function install_profile_info($profile, $langcode = 'en') {
$cache = &drupal_static(__FUNCTION__, array());
if (!isset($cache[$profile])) {
if (!isset($cache[$profile][$langcode])) {
// Set defaults for module info.
$defaults = array(
'dependencies' => array(),
......@@ -1067,9 +1067,9 @@ function install_profile_info($profile, $langcode = 'en') {
$info['dependencies'] = array_unique(array_merge($required, $info['dependencies'], $locale));
$cache[$profile] = $info;
$cache[$profile][$langcode] = $info;
}
return $cache[$profile];
return $cache[$profile][$langcode];
}
/**
......
......@@ -42,4 +42,22 @@ function testInstallerTranslationFiles() {
}
}
/**
* Tests profile info caching in non-English languages.
*/
function testInstallerTranslationCache() {
require_once 'core/includes/install.inc';
// Prime the drupal_get_filename() static cache with the location of the
// testing profile as it is not the currently active profile and we don't
// yet have any cached way to retrieve its location.
// @todo Remove as part of https://www.drupal.org/node/2186491
drupal_get_filename('profile', 'testing', 'core/profiles/testing/testing.info.yml');
$info_en = install_profile_info('testing', 'en');
$info_nl = install_profile_info('testing', 'nl');
$this->assertFalse(in_array('locale', $info_en['dependencies']), 'Locale is not set when installing in English.');
$this->assertTrue(in_array('locale', $info_nl['dependencies']), 'Locale is set when installing in Dutch.');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment