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
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Drupal\link\Plugin\Field\FieldFormatter;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
use Drupal\Component\Utility\UrlHelper;
|
||||
use Drupal\Core\Field\FieldDefinitionInterface;
|
||||
|
@ -201,7 +200,7 @@ class LinkFormatter extends FormatterBase implements ContainerFactoryPluginInter
|
|||
|
||||
if (!empty($settings['url_only']) && !empty($settings['url_plain'])) {
|
||||
$element[$delta] = array(
|
||||
'#markup' => SafeMarkup::checkPlain($link_title),
|
||||
'#plain_text' => $link_title,
|
||||
);
|
||||
|
||||
if (!empty($item->_attributes)) {
|
||||
|
|
47
core/modules/link/src/Plugin/migrate/cckfield/LinkField.php
Normal file
47
core/modules/link/src/Plugin/migrate/cckfield/LinkField.php
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\link\Plugin\migrate\cckfield\LinkField.
|
||||
*/
|
||||
|
||||
namespace Drupal\link\Plugin\migrate\cckfield;
|
||||
|
||||
use Drupal\migrate\Entity\MigrationInterface;
|
||||
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
|
||||
|
||||
/**
|
||||
* @PluginID("link")
|
||||
*/
|
||||
class LinkField extends CckFieldPluginBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFieldFormatterMap() {
|
||||
// See d6_field_formatter_settings.yml and CckFieldPluginBase
|
||||
// processFieldFormatter().
|
||||
return [
|
||||
'default' => 'link',
|
||||
'plain' => 'link',
|
||||
'absolute' => 'link',
|
||||
'title_plain' => 'link',
|
||||
'url' => 'link',
|
||||
'short' => 'link',
|
||||
'label' => 'link',
|
||||
'separate' => 'link_separate',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
|
||||
$process = [
|
||||
'plugin' => 'd6_cck_link',
|
||||
'source' => $field_name,
|
||||
];
|
||||
$migration->mergeProcessOfProperty($field_name, $process);
|
||||
}
|
||||
|
||||
}
|
58
core/modules/link/src/Plugin/migrate/process/d6/CckLink.php
Normal file
58
core/modules/link/src/Plugin/migrate/process/d6/CckLink.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\link\Plugin\migrate\process\d6\CckLink.
|
||||
*/
|
||||
|
||||
namespace Drupal\link\Plugin\migrate\process\d6;
|
||||
|
||||
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
||||
use Drupal\migrate\Entity\MigrationInterface;
|
||||
use Drupal\migrate\MigrateExecutableInterface;
|
||||
use Drupal\migrate\ProcessPluginBase;
|
||||
use Drupal\migrate\Row;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* @MigrateProcessPlugin(
|
||||
* id = "d6_cck_link"
|
||||
* )
|
||||
*/
|
||||
class CckLink extends ProcessPluginBase implements ContainerFactoryPluginInterface {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration) {
|
||||
parent::__construct($configuration, $plugin_id, $plugin_definition);
|
||||
$this->migration = $migration;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
|
||||
return new static(
|
||||
$configuration,
|
||||
$plugin_id,
|
||||
$plugin_definition,
|
||||
$migration
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
|
||||
// Drupal 6 link attributes are double serialized.
|
||||
$attributes = unserialize(unserialize($value['attributes']));
|
||||
|
||||
// Massage the values into the correct form for the link.
|
||||
$route['uri'] = $value['url'];
|
||||
$route['options']['attributes'] = $attributes;
|
||||
$route['title'] = $value['title'];
|
||||
return $route;
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue