Update to Drupal 8.1.5. For more information, see https://www.drupal.org/project/drupal/releases/8.1.5

This commit is contained in:
Pantheon Automation 2016-07-07 09:44:38 -07:00 committed by Greg Anderson
parent 13b6ca7cc2
commit 38ba7c357d
342 changed files with 7814 additions and 1534 deletions

View file

@ -662,7 +662,7 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
* {@inheritdoc}
*/
public function getMigrationDependencies() {
return $this->migration_dependencies + ['required' => [], 'optional' => []];
return ($this->migration_dependencies ?: []) + ['required' => [], 'optional' => []];
}
/**
@ -703,14 +703,14 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
* {@inheritdoc}
*/
public function getTrackLastImported() {
$this->trackLastImported;
return $this->trackLastImported;
}
/**
* {@inheritdoc}
*/
public function getDestinationIds() {
$this->destinationIds;
return $this->destinationIds;
}
}

View file

@ -88,6 +88,21 @@ abstract class Entity extends DestinationBase implements ContainerFactoryPluginI
return substr($plugin_id, 7);
}
/**
* Gets the bundle for the row taking into account the default.
*
* @param \Drupal\migrate\Row $row
* The current row we're importing.
*
* @return string
* The bundle for this row.
*/
public function getBundle(Row $row) {
$default_bundle = isset($this->configuration['default_bundle']) ? $this->configuration['default_bundle'] : '';
$bundle_key = $this->getKey('bundle');
return $row->getDestinationProperty($bundle_key) ?: $default_bundle;
}
/**
* {@inheritdoc}
*/
@ -112,6 +127,11 @@ abstract class Entity extends DestinationBase implements ContainerFactoryPluginI
$this->updateEntity($entity, $row);
}
else {
// Attempt to ensure we always have a bundle.
if ($bundle = $this->getBundle($row)) {
$row->setDestinationProperty($this->getKey('bundle'), $bundle);
}
// Stubs might need some required fields filled in.
if ($row->isStub()) {
$this->processStubRow($row);

View file

@ -143,7 +143,7 @@ abstract class SourcePluginBase extends PluginBase implements MigrateSourceInter
// Set up some defaults based on the source configuration.
$this->cacheCounts = !empty($configuration['cache_counts']);
$this->skipCount = !empty($configuration['skip_count']);
$this->cacheKey = !empty($configuration['cache_key']) ? !empty($configuration['cache_key']) : NULL;
$this->cacheKey = !empty($configuration['cache_key']) ? $configuration['cache_key'] : NULL;
$this->trackChanges = !empty($configuration['track_changes']) ? $configuration['track_changes'] : FALSE;
$this->idMap = $this->migration->getIdMap();