Update to Drupal 8.1.5. For more information, see https://www.drupal.org/project/drupal/releases/8.1.5
This commit is contained in:
parent
13b6ca7cc2
commit
38ba7c357d
342 changed files with 7814 additions and 1534 deletions
|
@ -3089,24 +3089,6 @@ $connection->schema()->createTable('content_type_page', array(
|
|||
'mysql_character_set' => 'utf8',
|
||||
));
|
||||
|
||||
$connection->insert('content_type_page')
|
||||
->fields(array(
|
||||
'vid',
|
||||
'nid',
|
||||
'field_text_field_value',
|
||||
))
|
||||
->values(array(
|
||||
'vid' => '1',
|
||||
'nid' => '1',
|
||||
'field_text_field_value' => NULL,
|
||||
))
|
||||
->values(array(
|
||||
'vid' => '3',
|
||||
'nid' => '1',
|
||||
'field_text_field_value' => NULL,
|
||||
))
|
||||
->execute();
|
||||
|
||||
$connection->schema()->createTable('content_type_story', array(
|
||||
'fields' => array(
|
||||
'nid' => array(
|
||||
|
@ -3420,9 +3402,9 @@ $connection->insert('content_type_story')
|
|||
'field_test_three_value' => '101.00',
|
||||
'field_test_identical1_value' => NULL,
|
||||
'field_test_identical2_value' => NULL,
|
||||
'field_test_link_url' => 'http://www.example.com/buy-one-upon-a-time',
|
||||
'field_test_link_url' => 'node/10',
|
||||
'field_test_link_title' => 'Buy it now',
|
||||
'field_test_link_attributes' => 'a:1:{s:6:"target";s:6:"_blank";}',
|
||||
'field_test_link_attributes' => 's:32:"a:1:{s:6:"target";s:6:"_blank";}";',
|
||||
'field_test_date_value' => NULL,
|
||||
'field_test_datestamp_value' => NULL,
|
||||
'field_test_datetime_value' => NULL,
|
||||
|
@ -45551,6 +45533,14 @@ $connection->insert('variable')
|
|||
'name' => 'language_content_type_article',
|
||||
'value' => 's:1:"2";',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'language_content_type_employee',
|
||||
'value' => 's:1:"2";',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'i18n_lock_node_article',
|
||||
'value' => 'i:1;',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'language_count',
|
||||
'value' => 'i:11;',
|
||||
|
|
|
@ -40789,7 +40789,7 @@ $connection->insert('users')
|
|||
->values(array(
|
||||
'uid' => '2',
|
||||
'name' => 'Odo',
|
||||
'pass' => '$S$DZ4P7zZOh92vgrgZDBbv8Pu6lQB337OJ1wsOy21602G4A5F7.M9K',
|
||||
'pass' => '$S$DGFZUE.FhrXbe4y52eC7p0ZVRGD/gOPtVctDlmC89qkujnBokAlJ',
|
||||
'mail' => 'odo@local.host',
|
||||
'theme' => '',
|
||||
'signature' => '',
|
||||
|
@ -41322,6 +41322,10 @@ $connection->insert('variable')
|
|||
'name' => 'language_content_type_test_content_type',
|
||||
'value' => 's:1:"0";',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'i18n_node_options_blog',
|
||||
'value' => 'a:2:{i:0;s:8:"required";i:1;s:4:"lock";}',
|
||||
))
|
||||
->values(array(
|
||||
'name' => 'language_count',
|
||||
'value' => 'i:2;',
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
name: 'Migrate cck field plugin manager test'
|
||||
type: module
|
||||
description: 'Example module demonstrating the cck field plugin manager in the Migrate API.'
|
||||
package: Testing
|
||||
version: VERSION
|
||||
core: 8.x
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\migrate_cckfield_plugin_manager_test\Plugin\migrate\cckfield;
|
||||
|
||||
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
|
||||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
|
||||
/**
|
||||
* @MigrateCckField(
|
||||
* id = "d6_file",
|
||||
* core = {6},
|
||||
* type_map = {
|
||||
* "file" = "file"
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
class D6FileField extends CckFieldPluginBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFieldFormatterMap() {}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\migrate_cckfield_plugin_manager_test\Plugin\migrate\cckfield;
|
||||
|
||||
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
|
||||
use Drupal\migrate\Plugin\MigrationInterface;
|
||||
|
||||
/**
|
||||
* @MigrateCckField(
|
||||
* id = "d6_no_core_version_specified"
|
||||
* )
|
||||
*/
|
||||
class D6NoCoreVersionSpecified extends CckFieldPluginBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFieldFormatterMap() {}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\migrate_drupal\Kernel;
|
||||
|
||||
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
|
||||
|
||||
/**
|
||||
* Tests the cck field plugin manager.
|
||||
*
|
||||
* @group migrate_drupal
|
||||
*/
|
||||
class MigrateCckFieldPluginManagerTest extends MigrateDrupalTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = array('system', 'user', 'field', 'migrate_drupal', 'options', 'file', 'text', 'migrate_cckfield_plugin_manager_test');
|
||||
|
||||
/**
|
||||
* Tests that the correct MigrateCckField plugins are used.
|
||||
*/
|
||||
public function testPluginSelection() {
|
||||
$plugin_manager = \Drupal::service('plugin.manager.migrate.cckfield');
|
||||
|
||||
$this->assertIdentical('Drupal\\file\\Plugin\\migrate\\cckfield\\d6\\FileField', get_class($plugin_manager->createInstance('filefield', ['core' => 6])));
|
||||
|
||||
try {
|
||||
// If this test passes, createInstance will raise a
|
||||
// PluginNotFoundException and we'll never reach fail().
|
||||
$plugin_manager->createInstance('filefield', ['core' => 7]);
|
||||
$this->fail('Expected Drupal\Component\Plugin\Exception\PluginNotFoundException.');
|
||||
}
|
||||
catch (PluginNotFoundException $e) {
|
||||
$this->assertIdentical($e->getMessage(), "Plugin ID 'filefield' was not found.");
|
||||
}
|
||||
|
||||
$this->assertIdentical('Drupal\\file\\Plugin\\migrate\\cckfield\\d7\\ImageField', get_class($plugin_manager->createInstance('image', ['core' => 7])));
|
||||
$this->assertIdentical('Drupal\\file\\Plugin\\migrate\\cckfield\\d7\\FileField', get_class($plugin_manager->createInstance('file', ['core' => 7])));
|
||||
$this->assertIdentical('Drupal\\migrate_cckfield_plugin_manager_test\\Plugin\\migrate\\cckfield\\D6FileField', get_class($plugin_manager->createInstance('file', ['core' => 6])));
|
||||
|
||||
$this->assertIdentical('Drupal\\text\\Plugin\\migrate\\cckfield\\TextField', get_class($plugin_manager->createInstance('text', ['core' => 6])));
|
||||
$this->assertIdentical('Drupal\\text\\Plugin\\migrate\\cckfield\\TextField', get_class($plugin_manager->createInstance('text', ['core' => 7])));
|
||||
|
||||
// Test fallback when no core version is specified.
|
||||
$this->assertIdentical('Drupal\\migrate_cckfield_plugin_manager_test\\Plugin\\migrate\\cckfield\\D6NoCoreVersionSpecified', get_class($plugin_manager->createInstance('d6_no_core_version_specified', ['core' => 6])));
|
||||
|
||||
try {
|
||||
// If this test passes, createInstance will raise a
|
||||
// PluginNotFoundException and we'll never reach fail().
|
||||
$plugin_manager->createInstance('d6_no_core_version_specified', ['core' => 7]);
|
||||
$this->fail('Expected Drupal\Component\Plugin\Exception\PluginNotFoundException.');
|
||||
}
|
||||
catch (PluginNotFoundException $e) {
|
||||
$this->assertIdentical($e->getMessage(), "Plugin ID 'd6_no_core_version_specified' was not found.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -28,7 +28,14 @@ abstract class MigrateDrupal6TestBase extends MigrateDrupalTestBase {
|
|||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->loadFixture( __DIR__ . '/../../../fixtures/drupal6.php');
|
||||
$this->loadFixture($this->getFixtureFilePath());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the path to the fixture file.
|
||||
*/
|
||||
protected function getFixtureFilePath() {
|
||||
return __DIR__ . '/../../../fixtures/drupal6.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,14 @@ abstract class MigrateDrupal7TestBase extends MigrateDrupalTestBase {
|
|||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->loadFixture(__DIR__ . '/../../../fixtures/drupal7.php');
|
||||
$this->loadFixture($this->getFixtureFilePath());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the path to the fixture file.
|
||||
*/
|
||||
protected function getFixtureFilePath() {
|
||||
return __DIR__ . '/../../../fixtures/drupal7.php';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue