Update to Drupal 8.0.0-beta15. For more information, see: https://www.drupal.org/node/2563023
This commit is contained in:
parent
2720a9ec4b
commit
f3791f1da3
1898 changed files with 54300 additions and 11481 deletions
14
core/modules/text/migration_templates/text_settings.yml
Normal file
14
core/modules/text/migration_templates/text_settings.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
id: text_settings
|
||||
label: Drupal teaser length configuration
|
||||
migration_tags:
|
||||
- Drupal 6
|
||||
- Drupal 7
|
||||
source:
|
||||
plugin: variable
|
||||
variables:
|
||||
- teaser_length
|
||||
process:
|
||||
default_summary_length: teaser_length
|
||||
destination:
|
||||
plugin: config
|
||||
config_name: text.settings
|
74
core/modules/text/src/Plugin/migrate/cckfield/TextField.php
Normal file
74
core/modules/text/src/Plugin/migrate/cckfield/TextField.php
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\text\Plugin\migrate\cckfield\TextField.
|
||||
*/
|
||||
|
||||
namespace Drupal\text\Plugin\migrate\cckfield;
|
||||
|
||||
use Drupal\migrate\Entity\MigrationInterface;
|
||||
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
|
||||
|
||||
/**
|
||||
* @PluginID("text")
|
||||
*/
|
||||
class TextField extends CckFieldPluginBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFieldWidgetMap() {
|
||||
return [
|
||||
'text_textfield' => 'text_textfield',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFieldFormatterMap() {
|
||||
return [
|
||||
'default' => 'text_default',
|
||||
'trimmed' => 'text_trimmed',
|
||||
'plain' => 'basic_string',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
|
||||
$process = array(
|
||||
array(
|
||||
'plugin' => 'iterator',
|
||||
'source' => $field_name,
|
||||
// See \Drupal\migrate_drupal\Plugin\migrate\source\d6\User::baseFields(),
|
||||
// signature_format for an example of the YAML that represents this
|
||||
// process array.
|
||||
'process' => [
|
||||
'value' => 'value',
|
||||
'format' => [
|
||||
[
|
||||
'plugin' => 'static_map',
|
||||
'bypass' => TRUE,
|
||||
'source' => 'format',
|
||||
'map' => [0 => NULL],
|
||||
],
|
||||
[
|
||||
'plugin' => 'skip_on_empty',
|
||||
'method' => 'process',
|
||||
],
|
||||
[
|
||||
'plugin' => 'migration',
|
||||
'migration' => 'd6_filter_format',
|
||||
'source' => 'format',
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
$migration->setProcessOfProperty($field_name, $process);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\text\Tests\Migrate\MigrateTextConfigsTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\text\Tests\Migrate;
|
||||
|
||||
use Drupal\config\Tests\SchemaCheckTestTrait;
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Upgrade variables to text.settings.yml.
|
||||
*
|
||||
* @group migrate_drupal_6
|
||||
*/
|
||||
class MigrateTextConfigsTest extends MigrateDrupal6TestBase {
|
||||
|
||||
use SchemaCheckTestTrait;
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('text');
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('text_settings');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests migration of text variables to text.settings.yml.
|
||||
*/
|
||||
public function testTextSettings() {
|
||||
$config = $this->config('text.settings');
|
||||
$this->assertIdentical(456, $config->get('default_summary_length'));
|
||||
$this->assertConfigSchema(\Drupal::service('config.typed'), 'text.settings', $config->get());
|
||||
}
|
||||
|
||||
}
|
|
@ -11,6 +11,9 @@
|
|||
* Auto-hide summary textarea if empty and show hide and unhide links.
|
||||
*
|
||||
* @type {Drupal~behavior}
|
||||
*
|
||||
* @prop {Drupal~behaviorAttach} attach
|
||||
* Attaches auto-hide behavior on `text-summary` events.
|
||||
*/
|
||||
Drupal.behaviors.textSummary = {
|
||||
attach: function (context, settings) {
|
||||
|
|
Reference in a new issue