Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
|
@ -107,7 +107,8 @@ class FieldItemNormalizer extends NormalizerBase {
|
|||
unset($items[$delta]);
|
||||
|
||||
// Instead, create a new item for the entity in the requested language.
|
||||
$entity_translation = $item->getEntity()->getTranslation($langcode);
|
||||
$entity = $item->getEntity();
|
||||
$entity_translation = $entity->hasTranslation($langcode) ? $entity->getTranslation($langcode) : $entity->addTranslation($langcode);
|
||||
$field_name = $item->getFieldDefinition()->getName();
|
||||
return $entity_translation->get($field_name)->appendItem();
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ class DenormalizeTest extends NormalizerTestBase {
|
|||
public function testMarkFieldForDeletion() {
|
||||
// Add a default value for a field.
|
||||
$field = FieldConfig::loadByName('entity_test', 'entity_test', 'field_test_text');
|
||||
$field->default_value = array(array('value' => 'Llama'));
|
||||
$field->setDefaultValue(array(array('value' => 'Llama')));
|
||||
$field->save();
|
||||
|
||||
// Denormalize data that contains no entry for the field, and check that
|
||||
|
|
|
@ -58,7 +58,7 @@ class NormalizeTest extends NormalizerTestBase {
|
|||
$entity = entity_create('entity_test', $values);
|
||||
$entity->save();
|
||||
// Add an English value for name and entity reference properties.
|
||||
$entity->getTranslation('en')->set('name', array(0 => array('value' => $translation_values['name'])));
|
||||
$entity->addTranslation('en')->set('name', array(0 => array('value' => $translation_values['name'])));
|
||||
$entity->getTranslation('en')->set('field_test_entity_reference', array(0 => $translation_values['field_test_entity_reference']));
|
||||
$entity->save();
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ abstract class NormalizerTestBase extends KernelTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('entity_test', 'entity_reference', 'field', 'hal', 'language', 'rest', 'serialization', 'system', 'text', 'user', 'filter');
|
||||
public static $modules = ['entity_test', 'field', 'hal', 'language', 'rest', 'serialization', 'system', 'text', 'user', 'filter'];
|
||||
|
||||
/**
|
||||
* The mock serializer.
|
||||
|
|
Reference in a new issue