updated core to 8.6.3
This commit is contained in:
@@ -28,7 +28,7 @@ interface MigrationWithFollowUpInterface {
|
||||
/**
|
||||
* Generates follow-up migrations.
|
||||
*
|
||||
* When the migration implementing this interface has been succesfully
|
||||
* When the migration implementing this interface has been successfully
|
||||
* executed, this method will be used to generate the follow-up migrations
|
||||
* which depends on the now migrated data.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\migrate_drupal\Plugin\migrate\source\d6;
|
||||
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\Core\State\StateInterface;
|
||||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
|
||||
/**
|
||||
* Gets Drupal i18n_variable source from database.
|
||||
*
|
||||
* @deprecated in Drupal 8.7.x and will be removed in Drupal 9.0.x.
|
||||
* Use \Drupal\migrate_drupal\Plugin\migrate\source\d6\VariableTranslation.
|
||||
*
|
||||
* @see https://www.drupal.org/node/3006487
|
||||
*
|
||||
* @MigrateSource(
|
||||
* id = "variable_translation",
|
||||
* source_module = "system",
|
||||
* )
|
||||
*/
|
||||
class D6VariableTranslation extends VariableTranslation {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state, EntityManagerInterface $entity_manager) {
|
||||
@trigger_error('The ' . __NAMESPACE__ . '\D6VariableTranslation is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Instead, use ' . __NAMESPACE__ . '\VariableTranslation. See https://www.drupal.org/node/3006487.', E_USER_DEPRECATED);
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $state, $entity_manager);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
|
||||
* Drupal i18n_variable source from database.
|
||||
*
|
||||
* @MigrateSource(
|
||||
* id = "variable_translation",
|
||||
* id = "d6_variable_translation",
|
||||
* source_module = "system",
|
||||
* )
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\migrate_drupal\Plugin\migrate\source\d7;
|
||||
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\Core\State\StateInterface;
|
||||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
|
||||
|
||||
/**
|
||||
* Gets Drupal variable_store source from database.
|
||||
*
|
||||
* @MigrateSource(
|
||||
* id = "d7_variable_translation",
|
||||
* source_module = "i18n_variable",
|
||||
* )
|
||||
*/
|
||||
class VariableTranslation extends DrupalSqlBase {
|
||||
/**
|
||||
* The variable names to fetch.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $variables;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state, EntityManagerInterface $entity_manager) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $state, $entity_manager);
|
||||
$this->variables = $this->configuration['variables'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function initializeIterator() {
|
||||
return new \ArrayIterator($this->values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the values of the variables specified in the plugin configuration.
|
||||
*
|
||||
* @return array
|
||||
* An associative array where the keys are the variables specified in the
|
||||
* plugin configuration and the values are the values found in the source.
|
||||
* A key/value pair is added for the language code. Only those values are
|
||||
* returned that are actually in the database.
|
||||
*/
|
||||
protected function values() {
|
||||
$values = [];
|
||||
$result = $this->prepareQuery()->execute()->FetchAllAssoc('realm_key');
|
||||
foreach ($result as $variable_store) {
|
||||
$values[]['language'] = $variable_store['realm_key'];
|
||||
}
|
||||
$result = $this->prepareQuery()->execute()->FetchAll();
|
||||
foreach ($result as $variable_store) {
|
||||
foreach ($values as $key => $value) {
|
||||
if ($values[$key]['language'] === $variable_store['realm_key']) {
|
||||
if ($variable_store['serialized']) {
|
||||
$values[$key][$variable_store['name']] = unserialize($variable_store['value']);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
$values[$key][$variable_store['name']] = $variable_store['value'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function count($refresh = FALSE) {
|
||||
return $this->initializeIterator()->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function fields() {
|
||||
return array_combine($this->variables, $this->variables);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getIds() {
|
||||
$ids['language']['type'] = 'string';
|
||||
return $ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function query() {
|
||||
return $this->select('variable_store', 'vs')
|
||||
->fields('vs')
|
||||
->condition('realm', 'language')
|
||||
->condition('name', (array) $this->configuration['variables'], 'IN');
|
||||
}
|
||||
|
||||
}
|
||||
+402
-18
@@ -1990,6 +1990,38 @@ $connection->insert('comments')
|
||||
'mail' => '',
|
||||
'homepage' => '',
|
||||
))
|
||||
->values(array(
|
||||
'cid' => '7',
|
||||
'pid' => '0',
|
||||
'nid' => '21',
|
||||
'uid' => '1',
|
||||
'subject' => 'Comment to John Smith - EN',
|
||||
'comment' => 'This is an English comment.',
|
||||
'hostname' => '2001:14ba:13f8:300:d9d0:363c:9fe4:66e1',
|
||||
'timestamp' => '1534014729',
|
||||
'status' => '0',
|
||||
'format' => '1',
|
||||
'thread' => '01/',
|
||||
'name' => 'root',
|
||||
'mail' => '',
|
||||
'homepage' => '',
|
||||
))
|
||||
->values(array(
|
||||
'cid' => '8',
|
||||
'pid' => '0',
|
||||
'nid' => '22',
|
||||
'uid' => '1',
|
||||
'subject' => 'Comment to John Smith - FR',
|
||||
'comment' => 'This is a French comment.',
|
||||
'hostname' => '2001:14ba:13f8:300:d9d0:363c:9fe4:66e1',
|
||||
'timestamp' => '1534014763',
|
||||
'status' => '0',
|
||||
'format' => '1',
|
||||
'thread' => '01/',
|
||||
'name' => 'root',
|
||||
'mail' => '',
|
||||
'homepage' => '',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('config', array(
|
||||
@@ -2168,6 +2200,18 @@ $connection->insert('content_field_company')
|
||||
'delta' => '0',
|
||||
'field_company_nid' => '15',
|
||||
))
|
||||
->values(array(
|
||||
'vid' => '2002',
|
||||
'nid' => '21',
|
||||
'delta' => '0',
|
||||
'field_company_nid' => NULL,
|
||||
))
|
||||
->values(array(
|
||||
'vid' => '2003',
|
||||
'nid' => '22',
|
||||
'delta' => '0',
|
||||
'field_company_nid' => NULL,
|
||||
))
|
||||
->values(array(
|
||||
'vid' => '21',
|
||||
'nid' => '18',
|
||||
@@ -2968,6 +3012,18 @@ $connection->insert('content_node_field')
|
||||
'active' => '1',
|
||||
'locked' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'field_name' => 'field_test_string_selectlist',
|
||||
'type' => 'text',
|
||||
'global_settings' => "a:4:{s:15:\"text_processing\";s:1:\"0\";s:10:\"max_length\";s:0:\"\";s:14:\"allowed_values\";s:18:\"A|Black\r\nB|White\r\n\";s:18:\"allowed_values_php\";s:0:\"\";}",
|
||||
'required' => '0',
|
||||
'multiple' => '0',
|
||||
'db_storage' => '1',
|
||||
'module' => 'text',
|
||||
'db_columns' => 'a:1:{s:5:"value";a:5:{s:4:"type";s:4:"text";s:4:"size";s:3:"big";s:8:"not null";b:0;s:8:"sortable";b:1;s:5:"views";b:1;}}',
|
||||
'active' => '1',
|
||||
'locked' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'field_name' => 'field_test_text_single_checkbox',
|
||||
'type' => 'text',
|
||||
@@ -3386,6 +3442,18 @@ $connection->insert('content_node_field_instance')
|
||||
'widget_module' => 'phone',
|
||||
'widget_active' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'field_name' => 'field_test_string_selectlist',
|
||||
'type_name' => 'story',
|
||||
'weight' => '31',
|
||||
'label' => 'String Select List Field',
|
||||
'widget_type' => 'optionwidgets_select',
|
||||
'widget_settings' => 'a:2:{s:13:"default_value";a:1:{i:0;a:1:{s:5:"value";s:0:"";}}s:17:"default_value_php";N;}',
|
||||
'display_settings' => 'a:5:{s:5:"label";a:2:{s:6:"format";s:5:"above";s:7:"exclude";i:0;}i:5;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}s:6:"teaser";a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}s:4:"full";a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}i:4;a:2:{s:6:"format";s:7:"default";s:7:"exclude";i:0;}}',
|
||||
'description' => '',
|
||||
'widget_module' => 'optionwidgets',
|
||||
'widget_active' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'field_name' => 'field_test_text_single_checkbox',
|
||||
'type_name' => 'story',
|
||||
@@ -3518,6 +3586,20 @@ $connection->insert('content_type_employee')
|
||||
'field_company_2_nid' => '15',
|
||||
'field_company_3_nid' => '16',
|
||||
))
|
||||
->values(array(
|
||||
'vid' => '2002',
|
||||
'nid' => '21',
|
||||
'field_commander_uid' => NULL,
|
||||
'field_company_2_nid' => NULL,
|
||||
'field_company_3_nid' => NULL,
|
||||
))
|
||||
->values(array(
|
||||
'vid' => '2003',
|
||||
'nid' => '22',
|
||||
'field_commander_uid' => NULL,
|
||||
'field_company_2_nid' => NULL,
|
||||
'field_company_3_nid' => NULL,
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('content_type_page', array(
|
||||
@@ -3764,6 +3846,11 @@ $connection->schema()->createTable('content_type_story', array(
|
||||
'not null' => FALSE,
|
||||
'length' => '100',
|
||||
),
|
||||
'field_test_string_selectlist_value' => array(
|
||||
'type' => 'text',
|
||||
'not null' => FALSE,
|
||||
'size' => 'big',
|
||||
),
|
||||
),
|
||||
'primary key' => array(
|
||||
'vid',
|
||||
@@ -3807,6 +3894,7 @@ $connection->insert('content_type_story')
|
||||
'field_test_text_single_checkbox2_value',
|
||||
'field_test_datestamp_value2',
|
||||
'field_test_datetime_value2',
|
||||
'field_test_string_selectlist_value',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '1',
|
||||
@@ -3838,6 +3926,7 @@ $connection->insert('content_type_story')
|
||||
'field_test_text_single_checkbox2_value' => 'Hello',
|
||||
'field_test_datestamp_value2' => NULL,
|
||||
'field_test_datetime_value2' => NULL,
|
||||
'field_test_string_selectlist_value' => NULL,
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '1',
|
||||
@@ -3869,6 +3958,7 @@ $connection->insert('content_type_story')
|
||||
'field_test_text_single_checkbox2_value' => NULL,
|
||||
'field_test_datestamp_value2' => NULL,
|
||||
'field_test_datetime_value2' => NULL,
|
||||
'field_test_string_selectlist_value' => NULL,
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '2',
|
||||
@@ -3900,6 +3990,7 @@ $connection->insert('content_type_story')
|
||||
'field_test_text_single_checkbox2_value' => NULL,
|
||||
'field_test_datestamp_value2' => NULL,
|
||||
'field_test_datetime_value2' => NULL,
|
||||
'field_test_string_selectlist_value' => NULL,
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '2',
|
||||
@@ -3931,6 +4022,7 @@ $connection->insert('content_type_story')
|
||||
'field_test_text_single_checkbox2_value' => NULL,
|
||||
'field_test_datestamp_value2' => NULL,
|
||||
'field_test_datetime_value2' => NULL,
|
||||
'field_test_string_selectlist_value' => NULL,
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '9',
|
||||
@@ -3962,6 +4054,7 @@ $connection->insert('content_type_story')
|
||||
'field_test_text_single_checkbox2_value' => 'Off',
|
||||
'field_test_datestamp_value2' => '1391357160',
|
||||
'field_test_datetime_value2' => '2015-03-04 06:07:00',
|
||||
'field_test_string_selectlist_value' => NULL,
|
||||
))
|
||||
->execute();
|
||||
|
||||
@@ -8666,6 +8759,16 @@ $connection->insert('history')
|
||||
'nid' => '19',
|
||||
'timestamp' => '1501955803',
|
||||
))
|
||||
->values(array(
|
||||
'uid' => '1',
|
||||
'nid' => '21',
|
||||
'timestamp' => '1534014729',
|
||||
))
|
||||
->values(array(
|
||||
'uid' => '1',
|
||||
'nid' => '22',
|
||||
'timestamp' => '1534014763',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('i18n_blocks', array(
|
||||
@@ -9888,6 +9991,86 @@ $connection->insert('i18n_strings')
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1680',
|
||||
'objectid' => 'employee-field_company',
|
||||
'type' => 'field',
|
||||
'property' => 'widget_label',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1681',
|
||||
'objectid' => 'employee-field_commander',
|
||||
'type' => 'field',
|
||||
'property' => 'widget_label',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1682',
|
||||
'objectid' => 'employee-field_company_2',
|
||||
'type' => 'field',
|
||||
'property' => 'widget_label',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1683',
|
||||
'objectid' => 'employee-field_company_3',
|
||||
'type' => 'field',
|
||||
'property' => 'widget_label',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1684',
|
||||
'objectid' => 'page-field_reference',
|
||||
'type' => 'field',
|
||||
'property' => 'widget_label',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1685',
|
||||
'objectid' => 'page-field_reference_2',
|
||||
'type' => 'field',
|
||||
'property' => 'widget_label',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1686',
|
||||
'objectid' => 'story-field_test_string_selectlist',
|
||||
'type' => 'field',
|
||||
'property' => 'widget_label',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1689',
|
||||
'objectid' => 'test_planet-field_test_text_single_checkbox',
|
||||
'type' => 'field',
|
||||
'property' => 'widget_label',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1690',
|
||||
'objectid' => 'field_test_string_selectlist',
|
||||
'type' => 'field',
|
||||
'property' => 'option_A',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1691',
|
||||
'objectid' => 'field_test_string_selectlist',
|
||||
'type' => 'field',
|
||||
'property' => 'option_B',
|
||||
'objectindex' => '0',
|
||||
'format' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('i18n_variable', array(
|
||||
@@ -15018,13 +15201,6 @@ $connection->insert('locales_source')
|
||||
'source' => 'An example multi-valued decimal field.',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '626',
|
||||
'location' => 'field:test_planet-field_test_text_single_checkbox:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Text Single Checkbox Field',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '627',
|
||||
'location' => 'field:test_planet-field_test_text_single_checkbox:widget_description',
|
||||
@@ -22396,6 +22572,76 @@ $connection->insert('locales_source')
|
||||
'source' => 'Translation test',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1680',
|
||||
'location' => 'field:employee-field_company:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Company',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1681',
|
||||
'location' => 'field:employee-field_commander:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Commanding Officer',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1682',
|
||||
'location' => 'field:employee-field_company_2:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Company 2',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1683',
|
||||
'location' => 'field:employee-field_company_3:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Company 3',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1684',
|
||||
'location' => 'field:page-field_reference:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Reference',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1685',
|
||||
'location' => 'field:page-field_reference_2:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Reference',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1686',
|
||||
'location' => 'field:story-field_test_string_selectlist:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'String Select List Field',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1689',
|
||||
'location' => 'field:test_planet-field_test_text_single_checkbox:widget_label',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Text Single Checkbox Field',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1690',
|
||||
'location' => 'field:field_test_string_selectlist:option_A',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'Black',
|
||||
'version' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1691',
|
||||
'location' => 'field:field_test_string_selectlist:option_B',
|
||||
'textgroup' => 'cck',
|
||||
'source' => 'White',
|
||||
'version' => '1',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('locales_target', array(
|
||||
@@ -27002,7 +27248,7 @@ $connection->insert('locales_target')
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '575',
|
||||
'translation' => 'fr - An example text field.',
|
||||
'translation' => 'fr - An example text field.',
|
||||
'language' => 'fr',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
@@ -27114,7 +27360,7 @@ $connection->insert('locales_target')
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '589',
|
||||
'translation' => 'fr - An example image field.',
|
||||
'translation' => 'fr - An example file field.',
|
||||
'language' => 'fr',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
@@ -27232,6 +27478,14 @@ $connection->insert('locales_target')
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '607',
|
||||
'translation' => 'fr - 1.234',
|
||||
'language' => 'fr',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '608',
|
||||
'translation' => 'fr - Integer Select List Field',
|
||||
@@ -27248,6 +27502,22 @@ $connection->insert('locales_target')
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '611',
|
||||
'translation' => 'fr - 2341',
|
||||
'language' => 'fr',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '613',
|
||||
'translation' => 'fr - 4123',
|
||||
'language' => 'fr',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '614',
|
||||
'translation' => 'fr - Text Single Checkbox Field',
|
||||
@@ -27344,14 +27614,6 @@ $connection->insert('locales_target')
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '626',
|
||||
'translation' => 'fr - Text Single Checkbox Field',
|
||||
'language' => 'fr',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '627',
|
||||
'translation' => 'fr - An example text field using a single on/off checkbox.',
|
||||
@@ -27448,6 +27710,14 @@ $connection->insert('locales_target')
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1690',
|
||||
'translation' => 'Noir',
|
||||
'language' => 'fr',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '66',
|
||||
'translation' => 'zu - CCK - Aucune Intégration aux Vues',
|
||||
@@ -27528,6 +27798,22 @@ $connection->insert('locales_target')
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '607',
|
||||
'translation' => 'zu - 1.234',
|
||||
'language' => 'zu',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '611',
|
||||
'translation' => 'zu - 2341',
|
||||
'language' => 'zu',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '621',
|
||||
'translation' => 'zu - Hello',
|
||||
@@ -27544,6 +27830,22 @@ $connection->insert('locales_target')
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1690',
|
||||
'translation' => 'Okumnyama',
|
||||
'language' => 'zu',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'lid' => '1691',
|
||||
'translation' => 'Mhlophe',
|
||||
'language' => 'zu',
|
||||
'plid' => '0',
|
||||
'plural' => '0',
|
||||
'i18n_status' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('menu_custom', array(
|
||||
@@ -43733,6 +44035,40 @@ $connection->insert('node')
|
||||
'tnid' => '12',
|
||||
'translate' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '21',
|
||||
'vid' => '2002',
|
||||
'type' => 'employee',
|
||||
'language' => 'en',
|
||||
'title' => 'John Smith - EN',
|
||||
'uid' => '1',
|
||||
'status' => '1',
|
||||
'created' => '1534014650',
|
||||
'changed' => '1534014650',
|
||||
'comment' => '2',
|
||||
'promote' => '1',
|
||||
'moderate' => '0',
|
||||
'sticky' => '0',
|
||||
'tnid' => '21',
|
||||
'translate' => '0',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '22',
|
||||
'vid' => '2003',
|
||||
'type' => 'employee',
|
||||
'language' => 'fr',
|
||||
'title' => 'John Smith - FR',
|
||||
'uid' => '1',
|
||||
'status' => '1',
|
||||
'created' => '1534014687',
|
||||
'changed' => '1534014687',
|
||||
'comment' => '2',
|
||||
'promote' => '1',
|
||||
'moderate' => '0',
|
||||
'sticky' => '0',
|
||||
'tnid' => '21',
|
||||
'translate' => '0',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('node_access', array(
|
||||
@@ -43939,6 +44275,20 @@ $connection->insert('node_comment_statistics')
|
||||
'last_comment_uid' => '1',
|
||||
'comment_count' => '3',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '21',
|
||||
'last_comment_timestamp' => '1534014729',
|
||||
'last_comment_name' => '',
|
||||
'last_comment_uid' => '1',
|
||||
'comment_count' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '22',
|
||||
'last_comment_timestamp' => '1534014763',
|
||||
'last_comment_name' => '',
|
||||
'last_comment_uid' => '1',
|
||||
'comment_count' => '1',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('node_counter', array(
|
||||
@@ -44074,6 +44424,18 @@ $connection->insert('node_counter')
|
||||
'daycount' => '4',
|
||||
'timestamp' => '1501955803',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '21',
|
||||
'totalcount' => '3',
|
||||
'daycount' => '3',
|
||||
'timestamp' => '1534014729',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '22',
|
||||
'totalcount' => '3',
|
||||
'daycount' => '3',
|
||||
'timestamp' => '1534014763',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('node_revisions', array(
|
||||
@@ -44402,6 +44764,28 @@ $connection->insert('node_revisions')
|
||||
'timestamp' => '1390095702',
|
||||
'format' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '21',
|
||||
'vid' => '2002',
|
||||
'uid' => '1',
|
||||
'title' => 'John Smith - EN',
|
||||
'body' => 'This is an English Bio text for employee John Smith. There is also a French translation to this node. Both language versions have comments.',
|
||||
'teaser' => 'This is an English Bio text for employee John Smith. There is also a French translation to this node. Both language versions have comments.',
|
||||
'log' => '',
|
||||
'timestamp' => '1534014650',
|
||||
'format' => '1',
|
||||
))
|
||||
->values(array(
|
||||
'nid' => '22',
|
||||
'vid' => '2003',
|
||||
'uid' => '1',
|
||||
'title' => 'John Smith - FR',
|
||||
'body' => 'This is a French Bio text for employee John Smith. The original node is in English. Both language versions have comments.',
|
||||
'teaser' => 'This is a French Bio text for employee John Smith. The original node is in English. Both language versions have comments.',
|
||||
'log' => '',
|
||||
'timestamp' => '1534014687',
|
||||
'format' => '1',
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('node_type', array(
|
||||
@@ -48356,7 +48740,7 @@ $connection->insert('variable')
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'i18ntaxonomy_vocabulary',
|
||||
'value' => 'a:2:{i:1;s:1:"3";i:2;s:1:"2";}',
|
||||
'value' => 'a:3:{i:1;s:1:"3";i:2;s:1:"2";i:3;s:1:"1";}',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'i18n_lock_node_article',
|
||||
|
||||
+1492
-17
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -5,7 +5,6 @@ namespace Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source;
|
||||
use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
|
||||
use Drupal\Core\Field\FieldStorageDefinitionInterface;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Drupal\field\Tests\EntityReference\EntityReferenceTestTrait;
|
||||
use Drupal\file\Entity\File;
|
||||
use Drupal\KernelTests\KernelTestBase;
|
||||
use Drupal\language\Entity\ConfigurableLanguage;
|
||||
@@ -16,6 +15,7 @@ use Drupal\node\Entity\Node;
|
||||
use Drupal\node\Entity\NodeType;
|
||||
use Drupal\taxonomy\Entity\Term;
|
||||
use Drupal\taxonomy\Entity\Vocabulary;
|
||||
use Drupal\Tests\field\Traits\EntityReferenceTestTrait;
|
||||
use Drupal\Tests\media\Traits\MediaTypeCreationTrait;
|
||||
use Drupal\user\Entity\User;
|
||||
|
||||
|
||||
+1
@@ -10,6 +10,7 @@ use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
|
||||
* @covers \Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable
|
||||
*
|
||||
* @group migrate_drupal
|
||||
* @group legacy
|
||||
*/
|
||||
class i18nVariableTest extends MigrateSqlSourceTestBase {
|
||||
|
||||
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\d7;
|
||||
|
||||
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
|
||||
|
||||
/**
|
||||
* Tests the variable source plugin.
|
||||
*
|
||||
* @covers \Drupal\migrate_drupal\Plugin\migrate\source\d7\VariableTranslation
|
||||
*
|
||||
* @group migrate_drupal
|
||||
*/
|
||||
class VariableTranslationTest extends MigrateSqlSourceTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['migrate_drupal'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function providerSource() {
|
||||
$tests = [];
|
||||
|
||||
// The source data.
|
||||
$tests[0]['source_data']['variable_store'] = [
|
||||
[
|
||||
'realm' => 'language',
|
||||
'realm_key' => 'fr',
|
||||
'name' => 'site_slogan',
|
||||
'value' => 'fr - site slogan',
|
||||
'serialized' => '0',
|
||||
],
|
||||
[
|
||||
'realm' => 'language',
|
||||
'realm_key' => 'fr',
|
||||
'name' => 'user_mail_status_blocked_subject',
|
||||
'value' => 'fr - BEGONE!',
|
||||
'serialized' => '0',
|
||||
],
|
||||
[
|
||||
'realm' => 'language',
|
||||
'realm_key' => 'is',
|
||||
'name' => 'site_slogan',
|
||||
'value' => 's:16:"is - site slogan";',
|
||||
'serialized' => '1',
|
||||
],
|
||||
];
|
||||
|
||||
// The expected results.
|
||||
$tests[0]['expected_data'] = [
|
||||
[
|
||||
'language' => 'fr',
|
||||
'site_slogan' => 'fr - site slogan',
|
||||
'user_mail_status_blocked_subject' => 'fr - BEGONE!',
|
||||
],
|
||||
[
|
||||
'language' => 'is',
|
||||
'site_slogan' => 'is - site slogan',
|
||||
],
|
||||
];
|
||||
|
||||
// The expected count.
|
||||
$tests[0]['expected_count'] = NULL;
|
||||
|
||||
// The migration configuration.
|
||||
$tests[0]['configuration']['variables'] = [
|
||||
'site_slogan',
|
||||
'user_mail_status_blocked_subject',
|
||||
];
|
||||
|
||||
return $tests;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -59,7 +59,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
|
||||
$node->moderation_state->value = 'published';
|
||||
$node->save();
|
||||
|
||||
// Insert data in the d6_node:page migration mappping table to simulate a
|
||||
// Insert data in the d6_node:page migration mapping table to simulate a
|
||||
// previously migrated node.
|
||||
$id_map = $this->getMigration('d6_node:page')->getIdMap();
|
||||
$table_name = $id_map->mapTableName();
|
||||
@@ -158,8 +158,8 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
|
||||
$node->setNewRevision(TRUE);
|
||||
$node->save();
|
||||
|
||||
// Insert data in the d6_node_revision:page migration mappping table to
|
||||
// simulate a previously migrated node revison.
|
||||
// Insert data in the d6_node_revision:page migration mapping table to
|
||||
// simulate a previously migrated node revision.
|
||||
$id_map = $this->getMigration('d6_node_revision:page')->getIdMap();
|
||||
$table_name = $id_map->mapTableName();
|
||||
$id_map->getDatabase()->insert($table_name)
|
||||
|
||||
@@ -59,7 +59,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
|
||||
$node->moderation_state->value = 'published';
|
||||
$node->save();
|
||||
|
||||
// Insert data in the d7_node:page migration mappping table to simulate a
|
||||
// Insert data in the d7_node:page migration mapping table to simulate a
|
||||
// previously migrated node.
|
||||
$id_map = $this->getMigration('d7_node:page')->getIdMap();
|
||||
$table_name = $id_map->mapTableName();
|
||||
@@ -157,8 +157,8 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
|
||||
$node->setNewRevision(TRUE);
|
||||
$node->save();
|
||||
|
||||
// Insert data in the d7_node_revision:page migration mappping table to
|
||||
// simulate a previously migrated node revison.
|
||||
// Insert data in the d7_node_revision:page migration mapping table to
|
||||
// simulate a previously migrated node revision.
|
||||
$id_map = $this->getMigration('d7_node_revision:page')->getIdMap();
|
||||
$table_name = $id_map->mapTableName();
|
||||
$id_map->getDatabase()->insert($table_name)
|
||||
|
||||
@@ -8,6 +8,7 @@ use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
* Tests the variable source plugin.
|
||||
*
|
||||
* @group migrate_drupal
|
||||
* @group legacy
|
||||
*/
|
||||
class VariableTranslationTest extends MigrateSqlSourceTestCase {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user