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:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -9,6 +9,7 @@ use Drupal\Component\Render\PlainTextOutput;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Asset\AttachedAssetsInterface;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Queue\QueueGarbageCollectionInterface;
use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ExtensionDiscovery;
@ -17,6 +18,7 @@ use Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory;
use Drupal\Core\PageCache\RequestPolicyInterface;
use Drupal\Core\PhpStorage\PhpStorageFactory;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Routing\StackedRouteMatchInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Menu\MenuTreeParameters;
use Drupal\Core\Extension\ModuleHandler;
@ -88,7 +90,7 @@ function system_help($route_name, RouteMatchInterface $route_match) {
$output .= '<dt>' . t('Disabling drag-and-drop functionality') . '</dt>';
$output .= '<dd>' . t('The default drag-and-drop user interface for ordering tables in the administrative interface presents a challenge for some users, including users of screen readers and other assistive technology. The drag-and-drop interface can be disabled in a table by clicking a link labeled "Show row weights" above the table. The replacement interface allows users to order the table by choosing numerical weights instead of dragging table rows.') . '</dd>';
$output .= '<dt>' . t('Configuring basic site settings') . '</dt>';
$output .= '<dd>' . t('The System module provides pages for managing basic site configuration, including <a href=":date-time-settings">Date and time formats</a> and basic <a href=":site-info">Site information</a> (site name, email address to send mail from, home page, and error pages). Additional configuration pages are listed on the main <a href=":config">Configuration page</a>.', array(':date-time-settings' => \Drupal::url('entity.date_format.collection'), ':site-info' => \Drupal::url('system.site_information_settings'), ':config' => \Drupal::url('system.admin_config'))) . '</dd>';
$output .= '<dd>' . t('The System module provides pages for managing basic site configuration, including <a href=":date-time-settings">Date and time formats</a> and <a href=":site-info">Basic site settings</a> (site name, email address to send mail from, home page, and error pages). Additional configuration pages are listed on the main <a href=":config">Configuration page</a>.', array(':date-time-settings' => \Drupal::url('entity.date_format.collection'), ':site-info' => \Drupal::url('system.site_information_settings'), ':config' => \Drupal::url('system.admin_config'))) . '</dd>';
$output .= '<dt>' . t('Checking site status') . '</dt>';
$output .= '<dd>' . t('The <a href=":status">Status report</a> provides an overview of the configuration, status, and health of your site. Review this report to make sure there are not any problems to address, and to find information about the software your site and web server are using.', array(':status' => \Drupal::url('system.status'))) . '</dd>';
$output .= '<dt>' . t('Using maintenance mode') . '</dt>';
@ -215,6 +217,13 @@ function system_theme() {
'variables' => array('menu_items' => NULL),
'file' => 'system.admin.inc',
),
'entity_add_list' => array(
'variables' => array(
'bundles' => array(),
'add_bundle_message' => NULL,
),
'template' => 'entity-add-list',
),
));
}
@ -314,6 +323,25 @@ function system_theme_suggestions_field(array $variables) {
return $suggestions;
}
/**
* Prepares variables for the list of available bundles.
*
* Default template: entity-add-list.html.twig.
*
* @param array $variables
* An associative array containing:
* - bundles: An array of bundles with the label, description, add_link keys.
* - add_bundle_message: The message shown when there are no bundles. Only
* available if the entity type uses bundle entities.
*/
function template_preprocess_entity_add_list(&$variables) {
foreach ($variables['bundles'] as $bundle_name => $bundle_info) {
$variables['bundles'][$bundle_name]['description'] = [
'#markup' => $bundle_info['description'],
];
}
}
/**
* @defgroup authorize Authorized operations
* @{
@ -646,7 +674,9 @@ function system_js_settings_build(&$settings, AttachedAssetsInterface $assets) {
* as well as theme_token ajax state.
*/
function system_js_settings_alter(&$settings, AttachedAssetsInterface $assets) {
$request = \Drupal::request();
// As this is being output in the final response always use the master
// request.
$request = \Drupal::requestStack()->getMasterRequest();
$current_query = $request->query->all();
// Let output path processors set a prefix.
@ -656,8 +686,12 @@ function system_js_settings_alter(&$settings, AttachedAssetsInterface $assets) {
$path_processor->processOutbound('/', $options);
$pathPrefix = $options['prefix'];
$current_path = \Drupal::routeMatch()->getRouteName() ? Url::fromRouteMatch(\Drupal::routeMatch())->getInternalPath() : '';
$current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute();
$route_match = \Drupal::routeMatch();
if ($route_match instanceof StackedRouteMatchInterface) {
$route_match = $route_match->getMasterRouteMatch();
}
$current_path = $route_match->getRouteName() ? Url::fromRouteMatch($route_match)->getInternalPath() : '';
$current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route_match->getRouteObject());
$path_settings = [
'baseUrl' => $request->getBaseUrl() . '/',
'pathPrefix' => $pathPrefix,
@ -1060,21 +1094,6 @@ function system_rebuild_module_data() {
return $modules_cache;
}
/**
* Returns an array of default theme features.
*
* @see \Drupal\Core\Extension\ThemeHandler::$defaultFeatures
*/
function _system_default_theme_features() {
return array(
'favicon',
'logo',
'node_user_picture',
'comment_user_picture',
'comment_user_verification',
);
}
/**
* Get a list of available regions from a specified theme.
*
@ -1266,21 +1285,10 @@ function system_cron() {
\Drupal::service('keyvalue.expirable.database')->garbageCollection();
}
// Clean up the queue for failed batches.
db_delete('queue')
->condition('created', REQUEST_TIME - 864000, '<')
->condition('name', 'drupal_batch:%', 'LIKE')
->execute();
// Reset expired items in the default queue implementation table. If that's
// not used, this will simply be a no-op.
db_update('queue')
->fields(array(
'expire' => 0,
))
->condition('expire', 0, '<>')
->condition('expire', REQUEST_TIME, '<')
->execute();
// Clean up any garbage in the queue service.
if (\Drupal::service('queue') instanceof QueueGarbageCollectionInterface) {
\Drupal::service('queue')->garbageCollection();
}
// Clean up PHP storage.
PhpStorageFactory::get('container')->garbageCollection();