Update to Drupal 8.1.1. For more information, see https://www.drupal.org/node/2718713

This commit is contained in:
Pantheon Automation 2016-05-04 14:35:41 -07:00 committed by Greg Anderson
parent c0a0d5a94c
commit 9eae24d844
669 changed files with 3873 additions and 1553 deletions

View file

@ -23,4 +23,3 @@ class EntityListController extends ControllerBase {
}
}

View file

@ -55,7 +55,7 @@ interface EntityFormDisplayInterface extends EntityDisplayInterface {
* // For 'single-value' widgets:
* '#theme' => 'field_multiple_value_form',
* '#cardinality' => The field cardinality,
* '#cardinality_multiple => TRUE if the field can contain multiple
* '#cardinality_multiple' => TRUE if the field can contain multiple
* items, FALSE otherwise.
* // One sub-array per copy of the widget, keyed by delta.
* 0 => array(

View file

@ -121,7 +121,7 @@ class EntityManager implements EntityManagerInterface, ContainerAwareInterface {
*
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
*/
public function createHandlerInstance($class, EntityTypeInterface $definition = null) {
public function createHandlerInstance($class, EntityTypeInterface $definition = NULL) {
return $this->container->get('entity_type.manager')->createHandlerInstance($class, $definition);
}

View file

@ -305,7 +305,7 @@ abstract class QueryBase implements QueryInterface {
*/
public function tableSort(&$headers) {
// If 'field' is not initialized, the header columns aren't clickable.
foreach ($headers as $key =>$header) {
foreach ($headers as $key => $header) {
if (is_array($header) && isset($header['specifier'])) {
$headers[$key]['field'] = '';
}

View file

@ -80,10 +80,21 @@ class Tables implements TablesInterface {
$entity_type = $this->entityManager->getDefinition($entity_type_id);
$field_storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
for ($key = 0; $key <= $count; $key ++) {
// If there is revision support and only the current revision is being
// queried then use the revision id. Otherwise, the entity id will do.
if (($revision_key = $entity_type->getKey('revision')) && $all_revisions) {
for ($key = 0; $key <= $count; $key++) {
// This can either be the name of an entity base field or a configurable
// field.
$specifier = $specifiers[$key];
if (isset($field_storage_definitions[$specifier])) {
$field_storage = $field_storage_definitions[$specifier];
}
else {
$field_storage = FALSE;
}
// If there is revision support, only the current revisions are being
// queried, and the field is revisionable then use the revision id.
// Otherwise, the entity id will do.
if (($revision_key = $entity_type->getKey('revision')) && $all_revisions && $field_storage && $field_storage->isRevisionable()) {
// This contains the relevant SQL field to be used when joining entity
// tables.
$entity_id_field = $revision_key;
@ -95,15 +106,6 @@ class Tables implements TablesInterface {
$entity_id_field = $entity_type->getKey('id');
$field_id_field = 'entity_id';
}
// This can either be the name of an entity base field or a configurable
// field.
$specifier = $specifiers[$key];
if (isset($field_storage_definitions[$specifier])) {
$field_storage = $field_storage_definitions[$specifier];
}
else {
$field_storage = FALSE;
}
/** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
$table_mapping = $this->entityManager->getStorage($entity_type_id)->getTableMapping();
@ -152,11 +154,18 @@ class Tables implements TablesInterface {
// finds the property first. The data table is preferred, which is why
// it gets added before the base table.
$entity_tables = array();
if ($data_table = $all_revisions ? $entity_type->getRevisionDataTable() : $entity_type->getDataTable()) {
if ($all_revisions && $field_storage && $field_storage->isRevisionable()) {
$data_table = $entity_type->getRevisionDataTable();
$entity_base_table = $entity_type->getRevisionTable();
}
else {
$data_table = $entity_type->getDataTable();
$entity_base_table = $entity_type->getBaseTable();
}
if ($data_table) {
$this->sqlQuery->addMetaData('simple_query', FALSE);
$entity_tables[$data_table] = $this->getTableMapping($data_table, $entity_type_id);
}
$entity_base_table = $all_revisions ? $entity_type->getRevisionTable() : $entity_type->getBaseTable();
$entity_tables[$entity_base_table] = $this->getTableMapping($entity_base_table, $entity_type_id);
$sql_column = $specifier;
@ -203,7 +212,7 @@ class Tables implements TablesInterface {
$entity_type = $this->entityManager->getDefinition($entity_type_id);
$field_storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
// Add the new entity base table using the table and sql column.
$join_condition= '%alias.' . $entity_type->getKey('id') . " = $table.$sql_column";
$join_condition = '%alias.' . $entity_type->getKey('id') . " = $table.$sql_column";
$base_table = $this->sqlQuery->leftJoin($entity_type->getBaseTable(), NULL, $join_condition);
$propertyDefinitions = array();
$key++;

View file

@ -201,7 +201,7 @@ class DefaultTableMapping implements TableMappingInterface {
$field_name = $storage_definition->getName();
if ($this->allowsSharedTableStorage($storage_definition)) {
$column_name = count($storage_definition->getColumns()) == 1 ? $field_name : $field_name . '__' . $property_name;
$column_name = count($storage_definition->getColumns()) == 1 ? $field_name : $field_name . '__' . $property_name;
}
elseif ($this->requiresDedicatedTableStorage($storage_definition)) {
$column_name = !in_array($property_name, $this->getReservedColumns()) ? $field_name . '_' . $property_name : $property_name;

View file

@ -1174,7 +1174,7 @@ class SqlContentEntityStorage extends ContentEntityStorageBase implements SqlEnt
$vid = $id;
}
$original = !empty($entity->original) ? $entity->original: NULL;
$original = !empty($entity->original) ? $entity->original : NULL;
// Determine which fields should be actually stored.
$definitions = $this->entityManager->getFieldDefinitions($entity_type, $bundle);

View file

@ -1263,7 +1263,9 @@ function hook_entity_query_alter(\Drupal\Core\Entity\Query\QueryInterface $query
* Act on entities being assembled before rendering.
*
* @param &$build
* A renderable array representing the entity content.
* A renderable array representing the entity content. The module may add
* elements to $build prior to rendering. The structure of $build is a
* renderable array as expected by drupal_render().
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity object.
* @param \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display
@ -1272,10 +1274,6 @@ function hook_entity_query_alter(\Drupal\Core\Entity\Query\QueryInterface $query
* @param $view_mode
* The view mode the entity is rendered in.
*
* The module may add elements to $build prior to rendering. The
* structure of $build is a renderable array as expected by
* drupal_render().
*
* @see hook_entity_view_alter()
* @see hook_ENTITY_TYPE_view()
*
@ -1297,7 +1295,9 @@ function hook_entity_view(array &$build, \Drupal\Core\Entity\EntityInterface $en
* Act on entities of a particular type being assembled before rendering.
*
* @param &$build
* A renderable array representing the entity content.
* A renderable array representing the entity content. The module may add
* elements to $build prior to rendering. The structure of $build is a
* renderable array as expected by drupal_render().
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity object.
* @param \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display
@ -1306,10 +1306,6 @@ function hook_entity_view(array &$build, \Drupal\Core\Entity\EntityInterface $en
* @param $view_mode
* The view mode the entity is rendered in.
*
* The module may add elements to $build prior to rendering. The
* structure of $build is a renderable array as expected by
* drupal_render().
*
* @see hook_ENTITY_TYPE_view_alter()
* @see hook_entity_view()
*