Update to Drupal 8.0.3. For more information, see https://www.drupal.org/drupal-8.0.3-release-notes

This commit is contained in:
Pantheon Automation 2016-02-03 14:56:31 -08:00 committed by Greg Anderson
parent 10f9f7fbde
commit 9db4fae9a7
202 changed files with 3806 additions and 760 deletions

View file

View file

@ -50,9 +50,8 @@ class AjaxTestController {
/**
* Returns a render array that will be rendered by AjaxRenderer.
*
* Ensures that \Drupal\Core\Ajax\AjaxResponse::ajaxRender()
* incorporates JavaScript settings generated during the page request by
* adding a dummy setting.
* Verifies that the response incorporates JavaScript settings generated
* during the page request by adding a dummy setting.
*/
public function render() {
return [

View file

@ -115,4 +115,14 @@ class FieldTestItem extends FieldItemBase {
return $this->getValue()['value'] == 'resave';
}
/**
* {@inheritdoc}
*/
public function delete() {
parent::delete();
$deleted_languages = \Drupal::state()->get('entity_test.delete.' . $this->getFieldDefinition()->getName()) ?: [];
$deleted_languages[] = $this->getLangcode();
\Drupal::state()->set('entity_test.delete.' . $this->getFieldDefinition()->getName(), $deleted_languages);
}
}

View file

@ -0,0 +1 @@
title: 'Original title'

View file

@ -7,3 +7,10 @@ menu_test.menu_item:
title:
type: label
label: 'Title'
menu_test.links.action:
type: config_object
label: 'Menu test local action'
mapping:
title:
type: label
label: 'Title'

View file

@ -11,6 +11,12 @@ menu_test.local_action5:
appears_on:
- menu_test.local_action1
menu_test.local_action.cache_check:
route_name: menu_test.local_action5
class: '\Drupal\menu_test\Plugin\Menu\LocalAction\TestLocalActionWithConfig'
appears_on:
- menu_test.local_action6
menu_test.local_action2:
route_name: menu_test.local_action2
title: 'My hook_menu action'

View file

@ -118,6 +118,13 @@ menu_test.local_action5:
requirements:
_access: 'TRUE'
menu_test.local_action6:
path: '/menu-test-local-action/cache-check'
defaults:
_controller: '\Drupal\menu_test\TestControllers::test2'
requirements:
_access: 'TRUE'
menu_test.contextual_test:
path: '/menu-test-contextual/default'
defaults:

View file

@ -0,0 +1,88 @@
<?php
/**
* @file
* Contains \Drupal\menu_test\Plugin\Menu\LocalAction\TestLocalActionWithConfig.
*/
namespace Drupal\menu_test\Plugin\Menu\LocalAction;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Config\Config;
use Drupal\Core\Menu\LocalActionDefault;
use Drupal\Core\Routing\RouteProviderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Defines a test local action plugin class that has cache tags.
*/
class TestLocalActionWithConfig extends LocalActionDefault implements CacheableDependencyInterface {
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
return [];
}
/**
* {@inheritdoc}
*/
public function getCacheTags() {
return ['config:menu_test.links.action'];
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
return Cache::PERMANENT;
}
/**
* @var \Drupal\Core\Config\Config
*/
protected $config;
/**
* {@inheritdoc}
*/
public function getTitle() {
return $this->config->get('title');
}
/**
* Constructs a TestLocalActionWithConfig object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
* The route provider to load routes by name.
* @param \Drupal\Core\Config\Config $config
* The 'menu_test.links.action' config.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteProviderInterface $route_provider, Config $config) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $route_provider);
$this->config = $config;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('router.route_provider'),
$container->get('config.factory')->get('menu_test.links.action')
);
}
}

View file

@ -341,4 +341,16 @@ class SystemTestController extends ControllerBase {
return $build;
}
/**
* Returns the current date.
*
* @return \Symfony\Component\HttpFoundation\Response $response
* A Response object containing the current date.
*/
public function getCurrentDate() {
// Uses specific time to test that the right timezone is used.
$response = new Response(\Drupal::service('date.formatter')->format(1452702549));
return $response;
}
}

View file

@ -150,3 +150,12 @@ system_test.respond_cacheable_response:
_controller: '\Drupal\system_test\Controller\SystemTestController::respondWithCacheableReponse'
requirements:
_access: 'TRUE'
system_test.date:
path: '/system-test/date'
defaults:
_controller: '\Drupal\system_test\Controller\SystemTestController::getCurrentDate'
options:
no_cache: 'TRUE'
requirements:
_access: 'TRUE'