Update Composer, update everything

This commit is contained in:
Oliver Davies 2018-11-23 12:29:20 +00:00
parent ea3e94409f
commit dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions

View file

@ -12,7 +12,6 @@ use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Html;
use Drupal\Component\Render\MarkupInterface;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\StorageException;
@ -240,8 +239,7 @@ function drupal_find_theme_templates($cache, $extension, $path) {
// Match templates based on the 'template' filename.
foreach ($cache as $hook => $info) {
if (isset($info['template'])) {
$template_candidates = [$info['template'], str_replace($info['theme path'] . '/templates/', '', $info['template'])];
if (in_array($template, $template_candidates)) {
if ($template === $info['template']) {
$implementations[$hook] = [
'template' => $template,
'path' => dirname($file->uri),
@ -345,7 +343,8 @@ function theme_get_setting($setting_name, $theme = NULL) {
// Generate the path to the logo image.
if ($cache[$theme]->get('logo.use_default')) {
$cache[$theme]->set('logo.url', file_url_transform_relative(file_create_url($theme_object->getPath() . '/logo.svg')));
$logo = \Drupal::service('theme.initialization')->getActiveThemeByName($theme)->getLogo();
$cache[$theme]->set('logo.url', file_url_transform_relative(file_create_url($logo)));
}
elseif ($logo_path = $cache[$theme]->get('logo.path')) {
$cache[$theme]->set('logo.url', file_url_transform_relative(file_create_url($logo_path)));
@ -462,7 +461,7 @@ function theme_render_and_autoescape($arg) {
*
* @param array $theme_settings
* An array of theme settings from system setting form or a Drupal 7 variable.
* @param Config $config
* @param \Drupal\Core\Config\Config $config
* The configuration object to update.
*
* @return
@ -486,7 +485,7 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config)
$config->set('favicon.mimetype', $value);
}
elseif (substr($key, 0, 7) == 'toggle_') {
$config->set('features.' . Unicode::substr($key, 7), $value);
$config->set('features.' . mb_substr($key, 7), $value);
}
elseif (!in_array($key, ['theme', 'logo_upload'])) {
$config->set($key, $value);
@ -571,6 +570,11 @@ function template_preprocess_datetime_wrapper(&$variables) {
if (!empty($element['#title'])) {
$variables['title'] = $element['#title'];
// If the element title is a string, wrap it a render array so that markup
// will not be escaped (but XSS-filtered).
if (is_string($variables['title']) && $variables['title'] !== '') {
$variables['title'] = ['#markup' => $variables['title']];
}
}
// Suppress error messages.
@ -625,16 +629,12 @@ function template_preprocess_datetime_wrapper(&$variables) {
* of links.
* - set_active_class: (optional) Whether each link should compare the
* route_name + route_parameters or href (path), language and query options
* to the current URL, to determine whether the link is "active". If so, an
* "active" class will be applied to the list item containing the link, as
* well as the link itself. It is important to use this sparingly since it
* is usually unnecessary and requires extra processing.
* For anonymous users, the "active" class will be calculated on the server,
* because most sites serve each anonymous user the same cached page anyway.
* For authenticated users, the "active" class will be calculated on the
* client (through JavaScript), only data- attributes are added to list
* items and contained links, to prevent breaking the render cache. The
* JavaScript is added in system_page_attachments().
* to the current URL, to determine whether the link is "active". If so,
* attributes will be added to the HTML elements for both the link and the
* list item that contains it, which will result in an "is-active" class
* being added to both. The class is added via JavaScript for authenticated
* users (in the active-link library), and via PHP for anonymous users (in
* the \Drupal\Core\EventSubscriber\ActiveLinkResponseFilter class).
* - heading: (optional) A heading to precede the links. May be an
* associative array or a string. If it's an array, it can have the
* following elements:
@ -694,7 +694,16 @@ function template_preprocess_links(&$variables) {
];
// Handle links and ensure that the active class is added on the LIs, but
// only if the 'set_active_class' option is not empty.
// only if the 'set_active_class' option is not empty. Links templates
// duplicate the "is-active" class handling of l() and
// LinkGenerator::generate() because they need to be able to set the
// "is-active" class not on the links themselves (<a> tags), but on the
// list items (<li> tags) that contain the links. This is necessary for
// CSS to be able to style list items differently when the link is active,
// since CSS does not yet allow one to style list items only if they
// contain a certain element with a certain class. That is, we cannot yet
// convert this jQuery selector to a CSS selector:
// jQuery('li:has("a.is-active")')
if (isset($link['url'])) {
if (!empty($variables['set_active_class'])) {
@ -707,6 +716,8 @@ function template_preprocess_links(&$variables) {
// Add a "data-drupal-link-query" attribute to let the
// drupal.active-link library know the query in a standardized manner.
// Only add the data- attribute. The "is-active" class will be
// calculated using JavaScript, to prevent breaking the render cache.
if (!empty($link['query'])) {
$query = $link['query'];
ksort($query);
@ -717,7 +728,10 @@ function template_preprocess_links(&$variables) {
$url = $link['url'];
if ($url->isRouted()) {
// Add a "data-drupal-link-system-path" attribute to let the
// drupal.active-link library know the path in a standardized manner.
// drupal.active-link library know the path in a standardized
// manner. Only add the data- attribute. The "is-active" class will
// be calculated using JavaScript, to prevent breaking the render
// cache.
$system_path = $url->getInternalPath();
// @todo System path is deprecated - use the route name and parameters.
// Special case for the front page.
@ -1191,10 +1205,9 @@ function template_preprocess_maintenance_task_list(&$variables) {
/**
* Adds a default set of helper variables for preprocessors and templates.
*
* This function is called for theme hooks implemented as templates only, not
* for theme hooks implemented as functions. This preprocess function is the
* first in the sequence of preprocessing functions that are called when
* preparing variables for a template.
* This function is called for every theme hook. It is the first in the
* sequence of preprocessing functions called when preparing variables for a
* template.
*
* See the @link themeable Default theme implementations topic @endlink for
* details.
@ -1358,9 +1371,9 @@ function template_preprocess_page(&$variables) {
}
}
$variables['base_path'] = base_path();
$variables['front_page'] = \Drupal::url('<front>');
$variables['language'] = $language_interface;
$variables['base_path'] = base_path();
$variables['front_page'] = \Drupal::url('<front>');
$variables['language'] = $language_interface;
// An exception might be thrown.
try {