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:
parent
13b6ca7cc2
commit
38ba7c357d
342 changed files with 7814 additions and 1534 deletions
|
|
@ -22,26 +22,6 @@ class NodePreviewController extends EntityViewController {
|
|||
// Don't render cache previews.
|
||||
unset($build['#cache']);
|
||||
|
||||
foreach ($node_preview->uriRelationships() as $rel) {
|
||||
// Set the node path as the canonical URL to prevent duplicate content.
|
||||
$build['#attached']['html_head_link'][] = array(
|
||||
array(
|
||||
'rel' => $rel,
|
||||
'href' => $node_preview->url($rel),
|
||||
)
|
||||
, TRUE);
|
||||
|
||||
if ($rel == 'canonical') {
|
||||
// Set the non-aliased canonical path as a default shortlink.
|
||||
$build['#attached']['html_head_link'][] = array(
|
||||
array(
|
||||
'rel' => 'shortlink',
|
||||
'href' => $node_preview->url($rel, array('alias' => TRUE)),
|
||||
)
|
||||
, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return $build;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ class D6NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
|
|||
'@type' => $node_type,
|
||||
]);
|
||||
$values['source']['node_type'] = $node_type;
|
||||
$values['destination']['default_bundle'] = $node_type;
|
||||
|
||||
// If this migration is based on the d6_node_revision migration, it
|
||||
// should explicitly depend on the corresponding d6_node variant.
|
||||
|
|
@ -111,7 +112,7 @@ class D6NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
|
|||
$field_type = $info['type'];
|
||||
if ($this->cckPluginManager->hasDefinition($info['type'])) {
|
||||
if (!isset($this->cckPluginCache[$field_type])) {
|
||||
$this->cckPluginCache[$field_type] = $this->cckPluginManager->createInstance($field_type, [], $migration);
|
||||
$this->cckPluginCache[$field_type] = $this->cckPluginManager->createInstance($field_type, ['core' => 6], $migration);
|
||||
}
|
||||
$this->cckPluginCache[$field_type]
|
||||
->processCckFieldValues($migration, $field_name, $info);
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ class D7NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
|
|||
'@type' => $row->getSourceProperty('name'),
|
||||
]);
|
||||
$values['source']['node_type'] = $node_type;
|
||||
$values['destination']['default_bundle'] = $node_type;
|
||||
|
||||
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($values);
|
||||
if (isset($fields[$node_type])) {
|
||||
|
|
@ -99,7 +100,7 @@ class D7NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
|
|||
$field_type = $info['type'];
|
||||
if ($this->cckPluginManager->hasDefinition($field_type)) {
|
||||
if (!isset($this->cckPluginCache[$field_type])) {
|
||||
$this->cckPluginCache[$field_type] = $this->cckPluginManager->createInstance($field_type, [], $migration);
|
||||
$this->cckPluginCache[$field_type] = $this->cckPluginManager->createInstance($field_type, ['core' => 7], $migration);
|
||||
}
|
||||
$this->cckPluginCache[$field_type]
|
||||
->processCckFieldValues($migration, $field_name, $info);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class Node extends DrupalSqlBase {
|
|||
$query->innerJoin('node', 'n', static::JOIN);
|
||||
|
||||
if (isset($this->configuration['node_type'])) {
|
||||
$query->condition('type', $this->configuration['node_type']);
|
||||
$query->condition('n.type', $this->configuration['node_type']);
|
||||
}
|
||||
|
||||
return $query;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class Node extends FieldableEntity {
|
|||
$query->innerJoin('node', 'n', static::JOIN);
|
||||
|
||||
if (isset($this->configuration['node_type'])) {
|
||||
$query->condition('type', $this->configuration['node_type']);
|
||||
$query->condition('n.type', $this->configuration['node_type']);
|
||||
}
|
||||
|
||||
return $query;
|
||||
|
|
|
|||
|
|
@ -296,6 +296,24 @@ class PagePreviewTest extends NodeTestBase {
|
|||
|
||||
// Check that the revision log field has the correct value.
|
||||
$this->assertFieldByName('revision_log[0][value]', $edit['revision_log[0][value]'], 'Revision log field displayed.');
|
||||
|
||||
// Save the node after coming back from the preview page so we can create a
|
||||
// forward revision for it.
|
||||
$this->drupalPostForm(NULL, [], t('Save'));
|
||||
$node = $this->drupalGetNodeByTitle($edit[$title_key]);
|
||||
|
||||
// Check that previewing a forward revision of a node works. This can not be
|
||||
// accomplished through the UI so we have to use API calls.
|
||||
// @todo Change this test to use the UI when we will be able to create
|
||||
// forward revisions in core.
|
||||
// @see https://www.drupal.org/node/2725533
|
||||
$node->setNewRevision(TRUE);
|
||||
$node->isDefaultRevision(FALSE);
|
||||
|
||||
/** @var \Drupal\Core\Controller\ControllerResolverInterface $controller_resolver */
|
||||
$controller_resolver = \Drupal::service('controller_resolver');
|
||||
$node_preview_controller = $controller_resolver->getControllerFromDefinition('\Drupal\node\Controller\NodePreviewController::view');
|
||||
$node_preview_controller($node, 'default');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Reference in a new issue