Update to Drupal 8.0.1. For more information, see https://www.drupal.org/node/2627402

This commit is contained in:
Pantheon Automation 2015-12-02 11:38:43 -08:00 committed by Greg Anderson
parent 013aaaf2ff
commit 1a0e9d9fac
153 changed files with 1268 additions and 670 deletions

View file

@ -311,8 +311,13 @@ function language_negotiation_url_domains() {
*/
function language_modules_installed($modules) {
if (!in_array('language', $modules)) {
// Since newly (un)installed modules may change the default settings for
// non-locked language types (e.g. content language), we need to resave the
// language type configuration.
/** @var \Drupal\language\LanguageNegotiatorInterface $negotiator */
$negotiator = \Drupal::service('language_negotiator');
$negotiator->updateConfiguration(array());
$configurable = \Drupal::config('language.types')->get('configurable');
$negotiator->updateConfiguration($configurable);
$negotiator->purgeConfiguration();
}
else {

View file

@ -181,8 +181,8 @@ class LanguageNegotiationContentEntity extends LanguageNegotiationMethodBase imp
* \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::processOutbound().
*
* @return bool
* TRUE if the the content entity language negotiator has higher priority
* than the url language negotiator, FALSE otherwise.
* TRUE if the content entity language negotiator has higher priority than
* the url language negotiator, FALSE otherwise.
*/
protected function hasLowerLanguageNegotiationWeight() {
if (!isset($this->hasLowerLanguageNegotiationWeightResult)) {

View file

@ -23,14 +23,14 @@ class LanguageNegotiationInfoTest extends WebTestBase {
*
* @var array
*/
public static $modules = array('language');
public static $modules = ['language', 'content_translation'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'view the administration theme'));
$admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages', 'view the administration theme', 'administer modules']);
$this->drupalLogin($admin_user);
$this->drupalPostForm('admin/config/regional/language/add', array('predefined_langcode' => 'it'), t('Add language'));
}
@ -174,4 +174,41 @@ class LanguageNegotiationInfoTest extends WebTestBase {
}
}
}
/**
* Tests altering config of configurable language types.
*/
public function testConfigLangTypeAlterations() {
// Default of config.
$test_type = LanguageInterface::TYPE_CONTENT;
$this->assertFalse($this->isLanguageTypeConfigurable($test_type), 'Language type is not configurable.');
// Editing config.
$edit = [$test_type . '[configurable]' => TRUE];
$this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is now configurable.');
// After installing another module, the config should be the same.
$this->drupalPostForm('admin/modules', ['modules[Testing][test_module][enable]' => 1], t('Install'));
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is still configurable.');
// After uninstalling the other module, the config should be the same.
$this->drupalPostForm('admin/modules/uninstall', ['uninstall[test_module]' => 1], t('Uninstall'));
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is still configurable.');
}
/**
* Checks whether the given language type is configurable.
*
* @param string $type
* The language type.
*
* @return bool
* TRUE if the specified language type is configurable, FALSE otherwise.
*/
protected function isLanguageTypeConfigurable($type) {
$configurable_types = $this->config('language.types')->get('configurable');
return in_array($type, $configurable_types);
}
}

View file

@ -0,0 +1,6 @@
name: 'Test Module'
type: module
description: 'Support module for testing.'
package: Testing
version: VERSION
core: 8.x