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
|
@ -15,9 +15,9 @@ function hal_help($route_name, RouteMatchInterface $route_match) {
|
|||
case 'help.page.hal':
|
||||
$output = '';
|
||||
$output .= '<h3>' . t('About') . '</h3>';
|
||||
$output .= '<p>' . t('<a href="!hal_spec">Hypertext Application Language (HAL)</a> is a format that supports the linking required for hypermedia APIs.', array('!hal_spec' => 'http://stateless.co/hal_specification.html')) . '</p>';
|
||||
$output .= '<p>' . t('Hypermedia APIs are a style of Web API that uses URIs to identify resources and the <a href="!link_rel">link relations</a> between them, enabling API consumers to follow links to discover API functionality.', array('!link_rel' => 'http://en.wikipedia.org/wiki/Link_relation')) . '</p>';
|
||||
$output .= '<p>' . t('This module adds support for serializing entities (such as content items, taxonomy terms, etc.) to the JSON version of HAL. For more information, see <a href="!hal_do">the online documentation for the HAL module</a>.', array('!hal_do' => 'https://www.drupal.org/documentation/modules/hal')) . '</p>';
|
||||
$output .= '<p>' . t('<a href=":hal_spec">Hypertext Application Language (HAL)</a> is a format that supports the linking required for hypermedia APIs.', array(':hal_spec' => 'http://stateless.co/hal_specification.html')) . '</p>';
|
||||
$output .= '<p>' . t('Hypermedia APIs are a style of Web API that uses URIs to identify resources and the <a href=":link_rel">link relations</a> between them, enabling API consumers to follow links to discover API functionality.', array(':link_rel' => 'http://en.wikipedia.org/wiki/Link_relation')) . '</p>';
|
||||
$output .= '<p>' . t('This module adds support for serializing entities (such as content items, taxonomy terms, etc.) to the JSON version of HAL. For more information, see the <a href=":hal_do">online documentation for the HAL module</a>.', array(':hal_do' => 'https://www.drupal.org/documentation/modules/hal')) . '</p>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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