Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542
This commit is contained in:
parent
3b2511d96d
commit
81ccda77eb
2155 changed files with 54307 additions and 46870 deletions
|
@ -123,6 +123,7 @@ class TranslateEditForm extends TranslateFormBase {
|
|||
for ($i = 0; $i < $plurals; $i++) {
|
||||
$form['strings'][$string->lid]['translations'][$i] = array(
|
||||
'#type' => 'textarea',
|
||||
// @todo Should use better labels https://www.drupal.org/node/2499639
|
||||
'#title' => ($i == 0 ? $this->t('Singular form') : $this->formatPlural($i, 'First plural form', '@count. plural form')),
|
||||
'#rows' => $rows,
|
||||
'#default_value' => isset($translation_array[$i]) ? $translation_array[$i] : '',
|
||||
|
|
|
@ -99,7 +99,7 @@ class TranslationStatusForm extends FormBase {
|
|||
),
|
||||
'status' => array(
|
||||
'class' => array('description', 'priority-low'),
|
||||
'data' => drupal_render($locale_translation_update_info),
|
||||
'data' => $locale_translation_update_info,
|
||||
),
|
||||
);
|
||||
if (!empty($update['not_found'])) {
|
||||
|
|
|
@ -117,7 +117,7 @@ class LocaleLookup extends CacheCollector {
|
|||
// for example, strings for admin menu items and settings forms are not
|
||||
// cached for anonymous users.
|
||||
$user = \Drupal::currentUser();
|
||||
$rids = $user ? implode(':', array_keys($user->getRoles())) : '0';
|
||||
$rids = $user ? implode(':', $user->getRoles()) : '';
|
||||
$this->cid = "locale:{$this->langcode}:{$this->context}:$rids";
|
||||
|
||||
// Getting the roles from the current user might have resulted in t()
|
||||
|
|
|
@ -190,9 +190,7 @@ abstract class StringBase implements StringInterface {
|
|||
$storage->save($this);
|
||||
}
|
||||
else {
|
||||
throw new StringStorageException(SafeMarkup::format('The string cannot be saved because its not bound to a storage: @string', array(
|
||||
'@string' => $this->getString(),
|
||||
)));
|
||||
throw new StringStorageException('The string cannot be saved because its not bound to a storage: ' . $this->getString());
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
@ -206,9 +204,7 @@ abstract class StringBase implements StringInterface {
|
|||
$storage->delete($this);
|
||||
}
|
||||
else {
|
||||
throw new StringStorageException(SafeMarkup::format('The string cannot be deleted because its not bound to a storage: @string', array(
|
||||
'@string' => $this->getString(),
|
||||
)));
|
||||
throw new StringStorageException('The string cannot be deleted because its not bound to a storage: ' . $this->getString());
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
|
|
|
@ -199,9 +199,7 @@ class StringDatabaseStorage implements StringStorageInterface {
|
|||
}
|
||||
}
|
||||
else {
|
||||
throw new StringStorageException(format_string('The string cannot be deleted because it lacks some key fields: @string', array(
|
||||
'@string' => $string->getString(),
|
||||
)));
|
||||
throw new StringStorageException('The string cannot be deleted because it lacks some key fields: ' . $string->getString());
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
@ -483,9 +481,7 @@ class StringDatabaseStorage implements StringStorageInterface {
|
|||
->execute();
|
||||
}
|
||||
else {
|
||||
throw new StringStorageException(format_string('The string cannot be saved: @string', array(
|
||||
'@string' => $string->getString(),
|
||||
)));
|
||||
throw new StringStorageException('The string cannot be saved: ' . $string->getString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -516,9 +512,7 @@ class StringDatabaseStorage implements StringStorageInterface {
|
|||
->execute();
|
||||
}
|
||||
else {
|
||||
throw new StringStorageException(format_string('The string cannot be updated: @string', array(
|
||||
'@string' => $string->getString(),
|
||||
)));
|
||||
throw new StringStorageException('The string cannot be updated: ' . $string->getString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ class LocaleConfigTranslationTest extends WebTestBase {
|
|||
$this->assertFalse($string, 'Configuration strings have been created upon installation.');
|
||||
|
||||
// Enable the image module.
|
||||
$this->drupalPostForm('admin/modules', array('modules[Field types][image][enable]' => "1"), t('Save configuration'));
|
||||
$this->drupalPostForm('admin/modules', array('modules[Field types][image][enable]' => "1"), t('Install'));
|
||||
$this->rebuildContainer();
|
||||
|
||||
$string = $this->storage->findString(array('source' => 'Medium (220×220)', 'context' => '', 'type' => 'configuration'));
|
||||
|
@ -204,12 +204,12 @@ class LocaleConfigTranslationTest extends WebTestBase {
|
|||
public function testOptionalConfiguration() {
|
||||
$this->assertNodeConfig(FALSE, FALSE);
|
||||
// Enable the node module.
|
||||
$this->drupalPostForm('admin/modules', ['modules[Core][node][enable]' => "1"], t('Save configuration'));
|
||||
$this->drupalPostForm('admin/modules', ['modules[Core][node][enable]' => "1"], t('Install'));
|
||||
$this->drupalPostForm(NULL, [], t('Continue'));
|
||||
$this->rebuildContainer();
|
||||
$this->assertNodeConfig(TRUE, FALSE);
|
||||
// Enable the views module (which node provides some optional config for).
|
||||
$this->drupalPostForm('admin/modules', ['modules[Core][views][enable]' => "1"], t('Save configuration'));
|
||||
$this->drupalPostForm('admin/modules', ['modules[Core][views][enable]' => "1"], t('Install'));
|
||||
$this->rebuildContainer();
|
||||
$this->assertNodeConfig(TRUE, TRUE);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class LocaleLocaleLookupTest extends WebTestBase {
|
|||
*/
|
||||
public function testCircularDependency() {
|
||||
// Ensure that we can enable early_translation_test on a non-english site.
|
||||
$this->drupalPostForm('admin/modules', array('modules[Testing][early_translation_test][enable]' => TRUE), t('Save configuration'));
|
||||
$this->drupalPostForm('admin/modules', array('modules[Testing][early_translation_test][enable]' => TRUE), t('Install'));
|
||||
$this->assertResponse(200);
|
||||
}
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
|
|||
$edit = array(
|
||||
'modules[Testing][locale_test_translate][enable]' => 'locale_test_translate',
|
||||
);
|
||||
$this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
|
||||
$this->drupalPostForm('admin/modules', $edit, t('Install'));
|
||||
|
||||
// Check if translations have been imported.
|
||||
$this->assertRaw(t('One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.',
|
||||
|
@ -350,7 +350,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
|
|||
$edit = array(
|
||||
'modules[Testing][locale_test_translate][enable]' => 'locale_test_translate',
|
||||
);
|
||||
$this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
|
||||
$this->drupalPostForm('admin/modules', $edit, t('Install'));
|
||||
|
||||
// Check if there is no Dutch translation yet.
|
||||
$this->assertTranslation('Extraday', '', 'nl');
|
||||
|
@ -394,7 +394,7 @@ class LocaleUpdateTest extends LocaleUpdateBase {
|
|||
$edit = array(
|
||||
'modules[Testing][locale_test_translate][enable]' => 'locale_test_translate',
|
||||
);
|
||||
$this->drupalPostForm('admin/modules', $edit, t('Save configuration'));
|
||||
$this->drupalPostForm('admin/modules', $edit, t('Install'));
|
||||
|
||||
// Create a custom language with language code 'xx' and a random
|
||||
// name.
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\locale\Tests\Migrate\d6\MigrateLocaleConfigsTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\locale\Tests\Migrate\d6;
|
||||
|
||||
use Drupal\config\Tests\SchemaCheckTestTrait;
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Upgrade variables to locale.settings.yml.
|
||||
*
|
||||
* @group locale
|
||||
*/
|
||||
class MigrateLocaleConfigsTest extends MigrateDrupal6TestBase {
|
||||
|
||||
use SchemaCheckTestTrait;
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('locale', 'language');
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->loadDumps(['Variable.php']);
|
||||
$this->executeMigration('d6_locale_settings');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests migration of locale variables to locale.settings.yml.
|
||||
*/
|
||||
public function testLocaleSettings() {
|
||||
$config = $this->config('locale.settings');
|
||||
$this->assertIdentical(TRUE, $config->get('cache_strings'));
|
||||
$this->assertIdentical('languages', $config->get('javascript.directory'));
|
||||
$this->assertConfigSchema(\Drupal::service('config.typed'), 'locale.settings', $config->get());
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue