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

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Encoder\JsonEncoder.
*/
namespace Drupal\serialization\Encoder;
use Symfony\Component\Serializer\Encoder\DecoderInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Encoder\XmlEncoder.
*/
namespace Drupal\serialization\Encoder;
use Symfony\Component\Serializer\Encoder\EncoderInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\EntityResolver\ChainEntityResolver.
*/
namespace Drupal\serialization\EntityResolver;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\EntityResolver\ChainEntityResolverInterface.
*/
namespace Drupal\serialization\EntityResolver;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\EntityResolver\EntityResolverInterface.
*/
namespace Drupal\serialization\EntityResolver;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\EntityResolver\TargetIdResolver.
*/
namespace Drupal\serialization\EntityResolver;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\EntityResolver\UuidReferenceInterface.
*/
namespace Drupal\serialization\EntityResolver;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\EntityResolver\UuidResolver.
*/
namespace Drupal\serialization\EntityResolver;
use Drupal\Core\Entity\EntityManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\ComplexDataNormalizer.
*/
namespace Drupal\serialization\Normalizer;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\ConfigEntityNormalizer.
*/
namespace Drupal\serialization\Normalizer;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\ContentEntityNormalizer.
*/
namespace Drupal\serialization\Normalizer;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\EntityNormalizer.
*/
namespace Drupal\serialization\Normalizer;
use Drupal\Core\Entity\EntityManagerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer.
*/
namespace Drupal\serialization\Normalizer;
use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
@ -27,12 +22,18 @@ class EntityReferenceFieldItemNormalizer extends ComplexDataNormalizer {
public function normalize($field_item, $format = NULL, array $context = []) {
$values = parent::normalize($field_item, $format, $context);
// Add a 'url' value if there is a reference and a canonical URL. Hard code
// 'canonical' here as config entities override the default $rel parameter
// value to 'edit-form.
/** @var \Drupal\Core\Entity\EntityInterface $entity */
if (($entity = $field_item->get('entity')->getValue()) && ($url = $entity->url('canonical'))) {
$values['url'] = $url;
if ($entity = $field_item->get('entity')->getValue()) {
$values['target_type'] = $entity->getEntityTypeId();
// Add the target entity UUID to the normalized output values.
$values['target_uuid'] = $entity->uuid();
// Add a 'url' value if there is a reference and a canonical URL. Hard
// code 'canonical' here as config entities override the default $rel
// parameter value to 'edit-form.
if ($url = $entity->url('canonical')) {
$values['url'] = $url;
}
}
return $values;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\ListNormalizer.
*/
namespace Drupal\serialization\Normalizer;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\MarkupNormalizer.
*/
namespace Drupal\serialization\Normalizer;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\NormalizerBase.
*/
namespace Drupal\serialization\Normalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\NullNormalizer.
*/
namespace Drupal\serialization\Normalizer;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Normalizer\TypedDataNormalizer.
*/
namespace Drupal\serialization\Normalizer;
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\RegisterEntityResolversCompilerPass.
*/
namespace Drupal\serialization;
use Symfony\Component\DependencyInjection\Reference;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\RegisterSerializationClassesCompilerPass.
*/
namespace Drupal\serialization;
use Symfony\Component\DependencyInjection\Reference;

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\SerializationServiceProvider.
*/
namespace Drupal\serialization;
use Drupal\Core\DependencyInjection\ContainerBuilder;

View file

@ -1,13 +1,11 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Tests\EntityResolverTest.
*/
namespace Drupal\serialization\Tests;
use Drupal\Core\Url;
use Drupal\entity_test\Entity\EntityTestMulRev;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests that entities references can be resolved.
@ -36,7 +34,7 @@ class EntityResolverTest extends NormalizerTestBase {
\Drupal::service('router.builder')->rebuild();
// Create the test field storage.
entity_create('field_storage_config', array(
FieldStorageConfig::create(array(
'entity_type' => 'entity_test_mulrev',
'field_name' => 'field_test_entity_reference',
'type' => 'entity_reference',
@ -46,11 +44,11 @@ class EntityResolverTest extends NormalizerTestBase {
))->save();
// Create the test field.
entity_create('field_config', array(
FieldConfig::create([
'entity_type' => 'entity_test_mulrev',
'field_name' => 'field_test_entity_reference',
'bundle' => 'entity_test_mulrev',
))->save();
])->save();
}
/**

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Tests\EntitySerializationTest.
*/
namespace Drupal\serialization\Tests;
use Drupal\Component\Utility\SafeMarkup;
@ -116,6 +111,8 @@ class EntitySerializationTest extends NormalizerTestBase {
'user_id' => array(
array(
'target_id' => $this->user->id(),
'target_type' => $this->user->getEntityTypeId(),
'target_uuid' => $this->user->uuid(),
'url' => $this->user->url(),
),
),
@ -190,7 +187,7 @@ class EntitySerializationTest extends NormalizerTestBase {
'name' => '<name><value>' . $this->values['name'] . '</value></name>',
'type' => '<type><value>entity_test_mulrev</value></type>',
'created' => '<created><value>' . $this->entity->created->value . '</value></created>',
'user_id' => '<user_id><target_id>' . $this->user->id() . '</target_id><url>' . $this->user->url() . '</url></user_id>',
'user_id' => '<user_id><target_id>' . $this->user->id() . '</target_id><target_type>' . $this->user->getEntityTypeId() . '</target_type><target_uuid>' . $this->user->uuid() . '</target_uuid><url>' . $this->user->url() . '</url></user_id>',
'revision_id' => '<revision_id><value>' . $this->entity->getRevisionId() . '</value></revision_id>',
'default_langcode' => '<default_langcode><value>1</value></default_langcode>',
'field_test_text' => '<field_test_text><value>' . $this->values['field_test_text']['value'] . '</value><format>' . $this->values['field_test_text']['format'] . '</format></field_test_text>',

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Tests\NormalizerTestBase.
*/
namespace Drupal\serialization\Tests;
use Drupal\KernelTests\KernelTestBase;
@ -25,13 +20,12 @@ abstract class NormalizerTestBase extends KernelTestBase {
$this->installEntitySchema('entity_test_mulrev');
$this->installEntitySchema('user');
$this->installSchema('system', array('url_alias', 'router'));
$this->installConfig(array('field'));
\Drupal::service('router.builder')->rebuild();
\Drupal::moduleHandler()->invoke('rest', 'install');
// Auto-create a field for testing.
FieldstorageConfig::create(array(
FieldStorageConfig::create(array(
'entity_type' => 'entity_test_mulrev',
'field_name' => 'field_test_text',
'type' => 'text',

View file

@ -1,10 +1,5 @@
<?php
/**
* @file
* Contains \Drupal\serialization\Tests\SerializationTest.
*/
namespace Drupal\serialization\Tests;
use Drupal\simpletest\KernelTestBase;