Update to Drupal 8.1.8. For more information, see https://www.drupal.org/project/drupal/releases/8.1.8
This commit is contained in:
parent
e9f047ccf8
commit
f9f23cdf38
312 changed files with 6751 additions and 1546 deletions
|
@ -169,7 +169,7 @@ class LinkItem extends FieldItemBase implements LinkItemInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function getUrl() {
|
||||
return Url::fromUri($this->uri);
|
||||
return Url::fromUri($this->uri, $this->options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\link\Plugin\migrate\cckfield\d7;
|
||||
|
||||
use Drupal\link\Plugin\migrate\cckfield\LinkField as D6LinkField;
|
||||
|
||||
/**
|
||||
* @MigrateCckField(
|
||||
* id = "link_field",
|
||||
* core = {7},
|
||||
* type_map = {
|
||||
* "link_field" = "link"
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* This plugin provides the exact same functionality as the Drupal 6 "link"
|
||||
* plugin with the exception that the plugin ID "link_field" is used in the
|
||||
* field type map.
|
||||
*/
|
||||
class LinkField extends D6LinkField {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFieldWidgetMap() {
|
||||
// By default, use the plugin ID for the widget types.
|
||||
return ['link_field' => 'link_default'];
|
||||
}
|
||||
|
||||
}
|
|
@ -78,6 +78,13 @@ class LinkItemTest extends FieldKernelTestBase {
|
|||
$entity->field_test->title = $title;
|
||||
$entity->field_test->first()->get('options')->set('query', $parsed_url['query']);
|
||||
$entity->field_test->first()->get('options')->set('attributes', array('class' => $class));
|
||||
$this->assertEquals([
|
||||
'query' => $parsed_url['query'],
|
||||
'attributes' => [
|
||||
'class' => $class,
|
||||
],
|
||||
'external' => TRUE,
|
||||
], $entity->field_test->first()->getUrl()->getOptions());
|
||||
$entity->name->value = $this->randomMachineName();
|
||||
$entity->save();
|
||||
|
||||
|
|
Reference in a new issue