Update to Drupal 8.1.2. For more information, see https://www.drupal.org/project/drupal/releases/8.1.2
This commit is contained in:
parent
9eae24d844
commit
28556d630e
1322 changed files with 6699 additions and 2064 deletions
|
|
@ -428,6 +428,13 @@ class ViewExecutable implements \Serializable {
|
|||
*/
|
||||
protected $routeProvider;
|
||||
|
||||
/**
|
||||
* The entity type of the base table, if available.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\EntityTypeInterface|false
|
||||
*/
|
||||
protected $baseEntityType;
|
||||
|
||||
/**
|
||||
* Constructs a new ViewExecutable object.
|
||||
*
|
||||
|
|
@ -961,6 +968,27 @@ class ViewExecutable implements \Serializable {
|
|||
return $base_tables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the entity type of the base table, if available.
|
||||
*
|
||||
* @return \Drupal\Core\Entity\EntityType|false
|
||||
* The entity type of the base table, or FALSE if none exists.
|
||||
*/
|
||||
public function getBaseEntityType() {
|
||||
if (!isset($this->baseEntityType)) {
|
||||
$view_base_table = $this->storage->get('base_table');
|
||||
$views_data = $this->viewsData->get($view_base_table);
|
||||
if (!empty($views_data['table']['entity type'])) {
|
||||
$entity_type_id = $views_data['table']['entity type'];
|
||||
$this->baseEntityType = \Drupal::entityTypeManager()->getDefinition($entity_type_id);
|
||||
}
|
||||
else {
|
||||
$this->baseEntityType = FALSE;
|
||||
}
|
||||
}
|
||||
return $this->baseEntityType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the preQuery() on all active handlers.
|
||||
*/
|
||||
|
|
@ -2034,7 +2062,13 @@ class ViewExecutable implements \Serializable {
|
|||
$defaults = $reflection->getDefaultProperties();
|
||||
// The external dependencies should not be reset. This is not generated by
|
||||
// the execution of a view.
|
||||
unset($defaults['storage'], $defaults['user'], $defaults['request'], $defaults['routeProvider']);
|
||||
unset(
|
||||
$defaults['storage'],
|
||||
$defaults['user'],
|
||||
$defaults['request'],
|
||||
$defaults['routeProvider'],
|
||||
$defaults['viewsData']
|
||||
);
|
||||
|
||||
foreach ($defaults as $property => $default) {
|
||||
$this->{$property} = $default;
|
||||
|
|
|
|||
Reference in a new issue