Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -3,7 +3,7 @@
|
|||
* Javascript behaviors for the Book module.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
(function ($, Drupal) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -34,4 +34,4 @@
|
|||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery, Drupal);
|
||||
|
|
|
@ -88,7 +88,7 @@ function book_entity_type_build(array &$entity_types) {
|
|||
/**
|
||||
* Implements hook_node_links_alter().
|
||||
*/
|
||||
function book_node_links_alter(array &$node_links, NodeInterface $node, array &$context) {
|
||||
function book_node_links_alter(array &$links, NodeInterface $node, array &$context) {
|
||||
if ($context['view_mode'] != 'rss') {
|
||||
$account = \Drupal::currentUser();
|
||||
|
||||
|
@ -97,14 +97,14 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$
|
|||
$child_type = \Drupal::config('book.settings')->get('child_type');
|
||||
$access_control_handler = \Drupal::entityManager()->getAccessControlHandler('node');
|
||||
if (($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines')) && $access_control_handler->createAccess($child_type) && $node->isPublished() && $node->book['depth'] < BookManager::BOOK_MAX_DEPTH) {
|
||||
$links['book_add_child'] = array(
|
||||
$book_links['book_add_child'] = array(
|
||||
'title' => t('Add child page'),
|
||||
'url' => Url::fromRoute('node.add', ['node_type' => $child_type], ['query' => ['parent' => $node->id()]]),
|
||||
);
|
||||
}
|
||||
|
||||
if ($account->hasPermission('access printer-friendly version')) {
|
||||
$links['book_printer'] = array(
|
||||
$book_links['book_printer'] = array(
|
||||
'title' => t('Printer-friendly version'),
|
||||
'url' => Url::fromRoute('book.export', [
|
||||
'type' => 'html',
|
||||
|
@ -116,10 +116,10 @@ function book_node_links_alter(array &$node_links, NodeInterface $node, array &$
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($links)) {
|
||||
$node_links['book'] = array(
|
||||
if (!empty($book_links)) {
|
||||
$links['book'] = array(
|
||||
'#theme' => 'links__node__book',
|
||||
'#links' => $links,
|
||||
'#links' => $book_links,
|
||||
'#attributes' => array('class' => array('links', 'inline')),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
services:
|
||||
book.breadcrumb:
|
||||
class: Drupal\book\BookBreadcrumbBuilder
|
||||
arguments: ['@entity.manager', '@access_manager', '@current_user']
|
||||
arguments: ['@entity.manager', '@current_user']
|
||||
tags:
|
||||
- { name: breadcrumb_builder, priority: 701 }
|
||||
book.manager:
|
||||
|
|
|
@ -20,4 +20,4 @@ destination:
|
|||
plugin: book
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d6_node:*
|
||||
- d6_node
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Access\BookNodeIsRemovableAccessCheck.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Access;
|
||||
|
||||
use Drupal\book\BookManagerInterface;
|
||||
|
@ -44,7 +39,7 @@ class BookNodeIsRemovableAccessCheck implements AccessInterface{
|
|||
* The access result.
|
||||
*/
|
||||
public function access(NodeInterface $node) {
|
||||
return AccessResult::allowedIf($this->bookManager->checkNodeIsRemovable($node))->cacheUntilEntityChanges($node);
|
||||
return AccessResult::allowedIf($this->bookManager->checkNodeIsRemovable($node))->addCacheableDependency($node);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\BookBreadcrumbBuilder.
|
||||
*/
|
||||
|
||||
namespace Drupal\book;
|
||||
|
||||
use Drupal\Core\Access\AccessManagerInterface;
|
||||
use Drupal\Core\Breadcrumb\Breadcrumb;
|
||||
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
|
@ -30,13 +24,6 @@ class BookBreadcrumbBuilder implements BreadcrumbBuilderInterface {
|
|||
*/
|
||||
protected $nodeStorage;
|
||||
|
||||
/**
|
||||
* The access manager.
|
||||
*
|
||||
* @var \Drupal\Core\Access\AccessManagerInterface
|
||||
*/
|
||||
protected $accessManager;
|
||||
|
||||
/**
|
||||
* The current user account.
|
||||
*
|
||||
|
@ -49,14 +36,11 @@ class BookBreadcrumbBuilder implements BreadcrumbBuilderInterface {
|
|||
*
|
||||
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
|
||||
* The entity manager service.
|
||||
* @param \Drupal\Core\Access\AccessManagerInterface $access_manager
|
||||
* The access manager.
|
||||
* @param \Drupal\Core\Session\AccountInterface $account
|
||||
* The current user account.
|
||||
*/
|
||||
public function __construct(EntityManagerInterface $entity_manager, AccessManagerInterface $access_manager, AccountInterface $account) {
|
||||
public function __construct(EntityManagerInterface $entity_manager, AccountInterface $account) {
|
||||
$this->nodeStorage = $entity_manager->getStorage('node');
|
||||
$this->accessManager = $access_manager;
|
||||
$this->account = $account;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\BookExport.
|
||||
*/
|
||||
|
||||
namespace Drupal\book;
|
||||
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\BookManager.
|
||||
*/
|
||||
|
||||
namespace Drupal\book;
|
||||
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\BookManagerInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\book;
|
||||
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\BookOutline.
|
||||
*/
|
||||
|
||||
namespace Drupal\book;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\BookOutlineStorage.
|
||||
*/
|
||||
|
||||
namespace Drupal\book;
|
||||
|
||||
use Drupal\Core\Database\Connection;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\BookOutlineStorageInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\book;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\BookUninstallValidator.
|
||||
*/
|
||||
|
||||
namespace Drupal\book;
|
||||
|
||||
use Drupal\Core\Entity\Query\QueryFactory;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Cache\BookNavigationCacheContext.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Cache;
|
||||
|
||||
use Drupal\Core\Cache\CacheableMetadata;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Controller\BookController.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Controller;
|
||||
|
||||
use Drupal\book\BookExport;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Form\BookAdminEditForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Form;
|
||||
|
||||
use Drupal\book\BookManager;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Form\BookOutlineForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Form;
|
||||
|
||||
use Drupal\book\BookManagerInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Form\BookRemoveForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Form;
|
||||
|
||||
use Drupal\book\BookManagerInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Form\BookSettingsForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Form;
|
||||
|
||||
use Drupal\Core\Form\ConfigFormBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Plugin\Block\BookNavigationBlock.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Plugin\Block;
|
||||
|
||||
use Drupal\Core\Block\BlockBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Plugin\migrate\destination\Book.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Plugin\migrate\destination;
|
||||
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Plugin\migrate\source\d6\Book.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Plugin\migrate\source\d6;
|
||||
|
||||
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\ProxyClass\BookUninstallValidator.
|
||||
*/
|
||||
// @codingStandardsIgnoreFile
|
||||
|
||||
/**
|
||||
* This file was generated via php core/scripts/generate-proxy-class.php 'Drupal\book\BookUninstallValidator' "core/modules/book/src".
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Tests\BookBreadcrumbTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Tests;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Tests\BookTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Tests;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Tests\BookUninstallTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Tests;
|
||||
namespace Drupal\Tests\book\Kernel;
|
||||
|
||||
use Drupal\node\Entity\Node;
|
||||
use Drupal\node\Entity\NodeType;
|
||||
use Drupal\simpletest\KernelTestBase;
|
||||
use Drupal\KernelTests\KernelTestBase;
|
||||
|
||||
/**
|
||||
* Tests that the Book module cannot be uninstalled if books exist.
|
|
@ -1,14 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Tests\Migrate\d6\MigrateBookConfigsTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\book\Tests\Migrate\d6;
|
||||
namespace Drupal\Tests\book\Kernel\Migrate\d6;
|
||||
|
||||
use Drupal\config\Tests\SchemaCheckTestTrait;
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Upgrade variables to book.settings.yml.
|
|
@ -1,13 +1,8 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\book\Tests\Migrate\d6\MigrateBookTest.
|
||||
*/
|
||||
namespace Drupal\Tests\book\Kernel\Migrate\d6;
|
||||
|
||||
namespace Drupal\book\Tests\Migrate\d6;
|
||||
|
||||
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\node\Entity\Node;
|
||||
|
||||
/**
|
||||
|
@ -30,7 +25,7 @@ class MigrateBookTest extends MigrateDrupal6TestBase {
|
|||
$this->installSchema('book', ['book']);
|
||||
$this->installSchema('node', ['node_access']);
|
||||
$this->migrateContent();
|
||||
$this->executeMigration('d6_book');
|
||||
$this->executeMigrations(['d6_node', 'd6_book']);
|
||||
}
|
||||
|
||||
/**
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\book\Unit\BookManagerTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\book\Unit;
|
||||
|
||||
use Drupal\book\BookManager;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\book\Unit\BookUninstallValidatorTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\book\Unit;
|
||||
|
||||
use Drupal\simpletest\AssertHelperTrait;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\book\Unit\Menu\BookLocalTasksTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\book\Unit\Menu;
|
||||
|
||||
use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\book\Unit\Plugin\migrate\source\d6\BookTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\book\Unit\Plugin\migrate\source\d6;
|
||||
|
||||
use Drupal\book\Plugin\migrate\source\d6\Book;
|
||||
|
|
Reference in a new issue