Update to Drupal 8.1.1. For more information, see https://www.drupal.org/node/2718713
This commit is contained in:
parent
c0a0d5a94c
commit
9eae24d844
669 changed files with 3873 additions and 1553 deletions
|
@ -8,6 +8,7 @@ use Drupal\Core\Ajax\AjaxResponse;
|
|||
use Drupal\Core\Ajax\ReplaceCommand;
|
||||
use Drupal\Core\Asset\AttachedAssets;
|
||||
use Drupal\Core\Asset\AttachedAssetsInterface;
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Render\HtmlResponse;
|
||||
use Drupal\Core\Render\RendererInterface;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
|
@ -73,6 +74,13 @@ class BigPipe implements BigPipeInterface {
|
|||
*/
|
||||
protected $eventDispatcher;
|
||||
|
||||
/**
|
||||
* The config factory.
|
||||
*
|
||||
* @var \Drupal\Core\Config\ConfigFactoryInterface
|
||||
*/
|
||||
protected $configFactory;
|
||||
|
||||
/**
|
||||
* Constructs a new BigPipe class.
|
||||
*
|
||||
|
@ -86,13 +94,16 @@ class BigPipe implements BigPipeInterface {
|
|||
* The HTTP kernel.
|
||||
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
|
||||
* The event dispatcher.
|
||||
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
|
||||
* The config factory.
|
||||
*/
|
||||
public function __construct(RendererInterface $renderer, SessionInterface $session, RequestStack $request_stack, HttpKernelInterface $http_kernel, EventDispatcherInterface $event_dispatcher) {
|
||||
public function __construct(RendererInterface $renderer, SessionInterface $session, RequestStack $request_stack, HttpKernelInterface $http_kernel, EventDispatcherInterface $event_dispatcher, ConfigFactoryInterface $config_factory) {
|
||||
$this->renderer = $renderer;
|
||||
$this->session = $session;
|
||||
$this->requestStack = $request_stack;
|
||||
$this->httpKernel = $http_kernel;
|
||||
$this->eventDispatcher = $event_dispatcher;
|
||||
$this->configFactory = $config_factory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -243,7 +254,7 @@ class BigPipe implements BigPipeInterface {
|
|||
$elements = $this->renderPlaceholder($placeholder, $placeholder_plus_cumulative_settings);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
if (\Drupal::config('system.logging')->get('error_level') === ERROR_REPORTING_DISPLAY_VERBOSE) {
|
||||
if ($this->configFactory->get('system.logging')->get('error_level') === ERROR_REPORTING_DISPLAY_VERBOSE) {
|
||||
throw $e;
|
||||
}
|
||||
else {
|
||||
|
@ -280,7 +291,7 @@ class BigPipe implements BigPipeInterface {
|
|||
$html_response = $this->filterEmbeddedResponse($fake_request, $html_response);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
if (\Drupal::config('system.logging')->get('error_level') === ERROR_REPORTING_DISPLAY_VERBOSE) {
|
||||
if ($this->configFactory->get('system.logging')->get('error_level') === ERROR_REPORTING_DISPLAY_VERBOSE) {
|
||||
throw $e;
|
||||
}
|
||||
else {
|
||||
|
@ -355,7 +366,7 @@ class BigPipe implements BigPipeInterface {
|
|||
$elements = $this->renderPlaceholder($placeholder_id, $placeholder_render_array);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
if (\Drupal::config('system.logging')->get('error_level') === ERROR_REPORTING_DISPLAY_VERBOSE) {
|
||||
if ($this->configFactory->get('system.logging')->get('error_level') === ERROR_REPORTING_DISPLAY_VERBOSE) {
|
||||
throw $e;
|
||||
}
|
||||
else {
|
||||
|
@ -388,7 +399,7 @@ class BigPipe implements BigPipeInterface {
|
|||
$ajax_response = $this->filterEmbeddedResponse($fake_request, $ajax_response);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
if (\Drupal::config('system.logging')->get('error_level') === ERROR_REPORTING_DISPLAY_VERBOSE) {
|
||||
if ($this->configFactory->get('system.logging')->get('error_level') === ERROR_REPORTING_DISPLAY_VERBOSE) {
|
||||
throw $e;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -105,12 +105,19 @@ class BigPipeStrategy implements PlaceholderStrategyInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function processPlaceholders(array $placeholders) {
|
||||
$request = $this->requestStack->getCurrentRequest();
|
||||
|
||||
// @todo remove this check when https://www.drupal.org/node/2367555 lands.
|
||||
if (!$request->isMethodSafe()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Routes can opt out from using the BigPipe HTML delivery technique.
|
||||
if ($this->routeMatch->getRouteObject()->getOption('_no_big_pipe')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!$this->sessionConfiguration->hasSession($this->requestStack->getCurrentRequest())) {
|
||||
if (!$this->sessionConfiguration->hasSession($request)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace Drupal\big_pipe\Tests;
|
|||
|
||||
use Drupal\big_pipe\Render\BigPipeMarkup;
|
||||
use Drupal\Core\Session\AccountInterface;
|
||||
use Drupal\Core\StringTranslation\PluralTranslatableMarkup;
|
||||
use Drupal\Core\Url;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
|
@ -93,7 +94,7 @@ class BigPipePlaceholderTestCases {
|
|||
'theme' => 'classy',
|
||||
'libraries' => 'big_pipe/big_pipe,classy/base,classy/messages,core/drupal.active-link,core/html5shiv,core/normalize,system/base',
|
||||
],
|
||||
'pluralDelimiter' => \Drupal\Core\StringTranslation\PluralTranslatableMarkup::DELIMITER,
|
||||
'pluralDelimiter' => PluralTranslatableMarkup::DELIMITER,
|
||||
'user' => [
|
||||
'uid' => '1',
|
||||
'permissionsHash' => $container->get('user_permissions_hash_generator')->generate($user),
|
||||
|
|
|
@ -361,7 +361,7 @@ class BigPipeTest extends WebTestBase {
|
|||
$csrf_token_seed = unserialize(explode('_sf2_meta|', $session_data)[1])['s'];
|
||||
$this->container->get('session_manager.metadata_bag')->setCsrfTokenSeed($csrf_token_seed);
|
||||
|
||||
return \Drupal\big_pipe\Tests\BigPipePlaceholderTestCases::cases($this->container, $this->rootUser);
|
||||
return BigPipePlaceholderTestCases::cases($this->container, $this->rootUser);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue