Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes

This commit is contained in:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -66,18 +66,18 @@ field.value.link:
mapping:
query:
type: sequence
label: 'Url query key value pairs'
label: 'URL query key value pairs'
sequence:
type: string
fragment:
type: string
label: 'Url fragment'
label: 'URL fragment'
absolute:
type: boolean
label: 'Is this Url absolute'
label: 'Is this URL absolute'
https:
type: boolean
label: 'If the Url should use a secure protocol'
label: 'If the URL should use a secure protocol'
attributes:
type: sequence
label: 'Link attributes'

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\LinkItemInterface.
*/
namespace Drupal\link;
use Drupal\Core\Field\FieldItemInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Field\FieldFormatter\LinkFormatter.
*/
namespace Drupal\link\Plugin\Field\FieldFormatter;
use Drupal\Component\Utility\Unicode;
@ -207,7 +202,7 @@ class LinkFormatter extends FormatterBase implements ContainerFactoryPluginInter
// field template wrapper, and set the URL value in a content
// attribute.
// @todo Does RDF need a URL rather than an internal URI here?
// @see \Drupal\rdf\Tests\Field\LinkFieldRdfaTest.
// @see \Drupal\Tests\rdf\Kernel\Field\LinkFieldRdfaTest.
$content = str_replace('internal:/', '', $item->uri);
$item->_attributes += array('content' => $content);
}

View file

@ -1,15 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Field\FieldFormatter\LinkSeparateFormatter.
*
* @todo
* Merge into 'link' formatter once there is a #type like 'item' that
* can render a compound label and content outside of a form context.
* @see https://www.drupal.org/node/1829202
*/
namespace Drupal\link\Plugin\Field\FieldFormatter;
use Drupal\Component\Utility\Unicode;
@ -18,6 +8,10 @@ use Drupal\Core\Field\FieldItemListInterface;
/**
* Plugin implementation of the 'link_separate' formatter.
*
* @todo https://www.drupal.org/node/1829202 Merge into 'link' formatter once
* there is a #type like 'item' that can render a compound label and content
* outside of a form context.
*
* @FieldFormatter(
* id = "link_separate",
* label = @Translation("Separate link text and URL"),

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Field\FieldType\LinkItem.
*/
namespace Drupal\link\Plugin\Field\FieldType;
use Drupal\Component\Utility\Random;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Field\FieldWidget\LinkWidget.
*/
namespace Drupal\link\Plugin\Field\FieldWidget;
use Drupal\Core\Entity\Element\EntityAutocomplete;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Validation\Constraint\LinkAccessConstraint.
*/
namespace Drupal\link\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraint;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Validation\Constraint\LinkAccessConstraintValidator.
*/
namespace Drupal\link\Plugin\Validation\Constraint;
use Drupal\Core\Session\AccountProxyInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Validation\Constraint\LinkExternalProtocolsConstraint.
*/
namespace Drupal\link\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraint;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Validation\Constraint\LinkExternalProtocolsConstraintValidator.
*/
namespace Drupal\link\Plugin\Validation\Constraint;
use Drupal\Component\Utility\UrlHelper;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Validation\Constraint\LinkNotExistingInternalConstraint.
*/
namespace Drupal\link\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraint;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Validation\Constraint\LinkNotExistingInternalConstraintValidator.
*/
namespace Drupal\link\Plugin\Validation\Constraint;
use Symfony\Component\Routing\Exception\InvalidParameterException;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\Validation\Constraint\LinkTypeConstraint.
*/
namespace Drupal\link\Plugin\Validation\Constraint;
use Drupal\link\LinkItemInterface;

View file

@ -1,13 +1,8 @@
<?php
/**
* @file
* Contains \Drupal\link\Plugin\migrate\cckfield\LinkField.
*/
namespace Drupal\link\Plugin\migrate\cckfield;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
/**

View file

@ -1,14 +1,9 @@
<?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\Plugin\MigrationInterface;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;

View file

@ -1,17 +1,15 @@
<?php
/**
* @file
* Contains \Drupal\link\Tests\LinkFieldTest.
*/
namespace Drupal\link\Tests;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Url;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\field\Entity\FieldConfig;
use Drupal\link\LinkItemInterface;
use Drupal\simpletest\WebTestBase;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests link field widgets and formatters.
@ -57,20 +55,20 @@ class LinkFieldTest extends WebTestBase {
function testURLValidation() {
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
$this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'link',
));
$this->fieldStorage->save();
$this->field = entity_create('field_config', array(
$this->field = FieldConfig::create([
'field_storage' => $this->fieldStorage,
'bundle' => 'entity_test',
'settings' => array(
'title' => DRUPAL_DISABLED,
'link_type' => LinkItemInterface::LINK_GENERIC,
),
));
]);
$this->field->save();
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($field_name, array(
@ -97,6 +95,12 @@ class LinkFieldTest extends WebTestBase {
// Create a node to test the link widget.
$node = $this->drupalCreateNode();
// Create an entity with restricted view access.
$entity_test_no_label_access = EntityTest::create([
'name' => 'forbid_access',
]);
$entity_test_no_label_access->save();
// Define some valid URLs (keys are the entered values, values are the
// strings displayed to the user).
$valid_external_entries = array(
@ -130,7 +134,7 @@ class LinkFieldTest extends WebTestBase {
// Entity URI displayed as ER autocomplete value when displayed in a form.
'entity:node/1' => $node->label() . ' (1)',
// URI for an entity that exists, but is not accessible by the user.
'entity:user/1' => '- Restricted access - (1)',
'entity:entity_test/' . $entity_test_no_label_access->id() => '- Restricted access - (' . $entity_test_no_label_access->id() . ')',
// URI for an entity that doesn't exist, but with a valid ID.
'entity:user/999999' => 'entity:user/999999',
);
@ -222,13 +226,13 @@ class LinkFieldTest extends WebTestBase {
function testLinkTitle() {
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
$this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'link',
));
$this->fieldStorage->save();
$this->field = entity_create('field_config', array(
$this->field = FieldConfig::create([
'field_storage' => $this->fieldStorage,
'bundle' => 'entity_test',
'label' => 'Read more about this entity',
@ -236,7 +240,7 @@ class LinkFieldTest extends WebTestBase {
'title' => DRUPAL_OPTIONAL,
'link_type' => LinkItemInterface::LINK_GENERIC,
),
));
]);
$this->field->save();
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($field_name, array(
@ -336,14 +340,14 @@ class LinkFieldTest extends WebTestBase {
function testLinkFormatter() {
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
$this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'link',
'cardinality' => 2,
));
$this->fieldStorage->save();
entity_create('field_config', array(
FieldConfig::create([
'field_storage' => $this->fieldStorage,
'label' => 'Read more about this entity',
'bundle' => 'entity_test',
@ -351,7 +355,7 @@ class LinkFieldTest extends WebTestBase {
'title' => DRUPAL_OPTIONAL,
'link_type' => LinkItemInterface::LINK_GENERIC,
),
))->save();
])->save();
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($field_name, array(
'type' => 'link_default',
@ -476,21 +480,21 @@ class LinkFieldTest extends WebTestBase {
function testLinkSeparateFormatter() {
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
$this->fieldStorage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'link',
'cardinality' => 2,
));
$this->fieldStorage->save();
entity_create('field_config', array(
FieldConfig::create([
'field_storage' => $this->fieldStorage,
'bundle' => 'entity_test',
'settings' => array(
'title' => DRUPAL_OPTIONAL,
'link_type' => LinkItemInterface::LINK_GENERIC,
),
))->save();
])->save();
$display_options = array(
'type' => 'link_separate',
'label' => 'hidden',

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Tests\LinkFieldUITest.
*/
namespace Drupal\link\Tests;
use Drupal\Component\Utility\Unicode;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\link\Tests\Views\LinkViewsTokensTest.
*/
namespace Drupal\link\Tests\Views;
use Drupal\field\Entity\FieldConfig;

View file

@ -1,18 +1,14 @@
<?php
/**
* @file
* Contains \Drupal\link\Tests\LinkItemTest.
*/
namespace Drupal\link\Tests;
namespace Drupal\Tests\link\Kernel;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Tests\FieldUnitTestBase;
use Drupal\Tests\field\Kernel\FieldKernelTestBase;
use Drupal\link\LinkItemInterface;
/**
@ -20,7 +16,7 @@ use Drupal\link\LinkItemInterface;
*
* @group link
*/
class LinkItemTest extends FieldUnitTestBase {
class LinkItemTest extends FieldKernelTestBase {
/**
* Modules to enable.
@ -73,7 +69,7 @@ class LinkItemTest extends FieldUnitTestBase {
*/
public function testLinkItem() {
// Create entity.
$entity = entity_create('entity_test');
$entity = EntityTest::create();
$url = 'https://www.drupal.org?test_param=test_value';
$parsed_url = UrlHelper::parse($url);
$title = $this->randomMachineName();
@ -158,7 +154,7 @@ class LinkItemTest extends FieldUnitTestBase {
// Test the generateSampleValue() method for generic, external, and internal
// link types.
$entity = entity_create('entity_test');
$entity = EntityTest::create();
$entity->field_test->generateSampleItems();
$entity->field_test_external->generateSampleItems();
$entity->field_test_internal->generateSampleItems();

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\link\Unit\Plugin\Validation\Constraint\LinkAccessConstraintValidatorTest.
*/
namespace Drupal\Tests\link\Unit\Plugin\Validation\Constraint;
use Drupal\link\Plugin\Validation\Constraint\LinkAccessConstraint;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\link\Unit\Plugin\Validation\Constraint\LinkExternalProtocolsConstraintValidatorTest.
*/
namespace Drupal\Tests\link\Unit\Plugin\Validation\Constraint;
use Drupal\Component\Utility\UrlHelper;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\Tests\link\Unit\Plugin\Validation\Constraint\LinkNotExistingInternalConstraintValidatorTest.
*/
namespace Drupal\Tests\link\Unit\Plugin\Validation\Constraint;
use Drupal\Core\Url;