diff --git a/core/CHANGELOG.txt b/core/CHANGELOG.txt index 609fd4ae0..a632835ce 100644 --- a/core/CHANGELOG.txt +++ b/core/CHANGELOG.txt @@ -11,7 +11,7 @@ Drupal 8.1.0, 2016-04-20 * Added Symfony Polyfill Iconv 1.1.0. * Added paragonie/random_compat 1.4.1. - Updated vendor libraries: - * Updated to Symfony 2.8.4. + * Updated to the last 2.x minor version of Symfony: 2.8 (2.8.4). * Updated to CKEditor 4.5.8. * Updated to Modernizr 3.3.1. - Added modules: @@ -34,12 +34,13 @@ Drupal 8.1.0, 2016-04-20 reducing the code needed to extend them. * Simplified Migrate API by replacing migration configuration entities with migration plugins. - * Added support for entity types to specify translatable plural labels. - * Added a revision log interface and trait for revisionable entity types. - * Added key field definitions to ContentEntityBase, reducing code from - child classes. - * Added generic route providers for add-page and add-form entity routes, - reducing the code needed to define an entity type. + * Various improvements for defining entity types: + * Added support for entity types to specify translatable plural labels. + * Added a revision log interface and trait for revisionable entity types. + * Added key field definitions to ContentEntityBase, reducing code from + child classes. + * Added generic route providers for add-page and add-form entity routes, + reducing the code needed to define an entity type. - Testing improvements: * Added support for automated JavaScript testing. * Added verbose output for BrowserTestBase. @@ -414,8 +415,8 @@ Drupal 7.0, 2011-01-05 are available. - OpenID: * Added support for Gmail and Google Apps for Domain identifiers. Users can - now login with their user@example.com identifier when example.com is powered - by Google. + now log in with their user@example.com identifier when example.com is + powered by Google. * Made the OpenID module more pluggable. - Added code registry: * Using the registry, modules declare their includable files via their .info file, diff --git a/core/MAINTAINERS.txt b/core/MAINTAINERS.txt index 8f456ebd9..8ca4bbd66 100644 --- a/core/MAINTAINERS.txt +++ b/core/MAINTAINERS.txt @@ -314,6 +314,7 @@ Database Logging module - Khalid Baheyeldin 'kbahey' https://www.drupal.org/u/kbahey DateTime module +- Jonathan Hedstrom 'jhedstrom' https://www.drupal.org/u/jhedstrom - Matthew Donadio 'mpdonadio' https://www.drupal.org/u/mpdonadio Dynamic Page Cache module diff --git a/core/composer.json b/core/composer.json index 16e542a92..ad8542564 100644 --- a/core/composer.json +++ b/core/composer.json @@ -140,10 +140,8 @@ "Drupal\\Component\\": "lib/Drupal/Component", "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver" }, - "files": [ - "lib/Drupal.php" - ], "classmap": [ + "lib/Drupal.php", "lib/Drupal/Component/Utility/Timer.php", "lib/Drupal/Component/Utility/Unicode.php", "lib/Drupal/Core/Database/Database.php", diff --git a/core/core.services.yml b/core/core.services.yml index d9b1839cd..5877a38c1 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -80,6 +80,11 @@ services: arguments: ['@request_stack'] tags: - { name: cache.context } + cache_context.url.path.parent: + class: Drupal\Core\Cache\Context\PathParentCacheContext + arguments: ['@request_stack'] + tags: + - { name: cache.context } cache_context.url.query_args: class: Drupal\Core\Cache\Context\QueryArgsCacheContext arguments: ['@request_stack'] diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 589d451c3..2294d4705 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -623,7 +623,7 @@ function drupal_valid_test_ua($new_prefix = NULL) { $user_agent = isset($_COOKIE['SIMPLETEST_USER_AGENT']) ? $_COOKIE['SIMPLETEST_USER_AGENT'] : $http_user_agent; if (isset($user_agent) && preg_match("/^(simpletest\d+):(.+):(.+):(.+)$/", $user_agent, $matches)) { list(, $prefix, $time, $salt, $hmac) = $matches; - $check_string = $prefix . ':' . $time . ':' . $salt; + $check_string = $prefix . ':' . $time . ':' . $salt; // Read the hash salt prepared by drupal_generate_test_ua(). // This function is called before settings.php is read and Drupal's error // handlers are set up. While Drupal's error handling may be properly diff --git a/core/includes/common.inc b/core/includes/common.inc index 03af03bbb..feceb5bbe 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -14,6 +14,7 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Utility\SortArray; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Cache\Cache; +use Drupal\Core\Render\Element\Link; use Drupal\Core\Render\Markup; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\Core\PhpStorage\PhpStorageFactory; @@ -748,7 +749,7 @@ function drupal_clear_js_cache() { * Use \Drupal\Core\Render\Element\Link::preRenderLink(). */ function drupal_pre_render_link($element) { - return Element\Link::preRenderLink($element); + return Link::preRenderLink($element); } /** diff --git a/core/includes/form.inc b/core/includes/form.inc index c110c5b31..06a806be9 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -7,6 +7,7 @@ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Render\Element; +use Drupal\Core\Render\Element\RenderElement; use Drupal\Core\Template\Attribute; use Drupal\Core\Url; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -29,7 +30,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; function template_preprocess_select(&$variables) { $element = $variables['element']; Element::setAttributes($element, array('id', 'name', 'size')); - Element\RenderElement::setAttributes($element, array('form-select')); + RenderElement::setAttributes($element, array('form-select')); $variables['attributes'] = $element['#attributes']; $variables['options'] = form_select_options($element); @@ -191,7 +192,7 @@ function form_get_options($element, $key) { function template_preprocess_fieldset(&$variables) { $element = $variables['element']; Element::setAttributes($element, array('id')); - Element\RenderElement::setAttributes($element); + RenderElement::setAttributes($element); $variables['attributes'] = isset($element['#attributes']) ? $element['#attributes'] : array(); $variables['prefix'] = isset($element['#field_prefix']) ? $element['#field_prefix'] : NULL; $variables['suffix'] = isset($element['#field_suffix']) ? $element['#field_suffix'] : NULL; @@ -376,7 +377,7 @@ function template_preprocess_form(&$variables) { function template_preprocess_textarea(&$variables) { $element = $variables['element']; Element::setAttributes($element, array('id', 'name', 'rows', 'cols', 'placeholder')); - Element\RenderElement::setAttributes($element, array('form-textarea')); + RenderElement::setAttributes($element, array('form-textarea')); $variables['wrapper_attributes'] = new Attribute(); $variables['attributes'] = new Attribute($element['#attributes']); $variables['value'] = $element['#value']; diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 7a9812f4a..1938ed691 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -7,7 +7,6 @@ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\DrupalKernel; -use Drupal\Core\Config\BootstrapConfigStorageFactory; use Drupal\Core\Database\Database; use Drupal\Core\Database\DatabaseExceptionWrapper; use Drupal\Core\Form\FormState; @@ -489,8 +488,7 @@ function install_begin_request($class_loader, &$install_state) { // Ensure that the active configuration is empty before installation starts. if ($install_state['config_verified'] && empty($task)) { - $config = BootstrapConfigStorageFactory::get()->listAll(); - if (!empty($config)) { + if (count($kernel->getConfigStorage()->listAll())) { $task = NULL; throw new AlreadyInstalledException($container->get('string_translation')); } @@ -1799,7 +1797,7 @@ function install_check_translations($langcode, $server_pattern) { $writable = FALSE; // @todo: Make this configurable. $site_path = \Drupal::service('site.path'); - $files_directory = $site_path . '/files'; + $files_directory = $site_path . '/files'; $translations_directory = $site_path . '/files/translations'; $translations_directory_exists = FALSE; $online = FALSE; diff --git a/core/includes/install.inc b/core/includes/install.inc index 31207994e..6578a83ec 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -515,7 +515,7 @@ function drupal_install_config_directories() { // they can later be added to git. Since this directory is auto-created, we // have to write out the README rather than just adding it to the drupal core // repo. - $text = 'This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync.' .' For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config'; + $text = 'This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync.' .' For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config'; file_put_contents(config_get_config_directory(CONFIG_SYNC_DIRECTORY) . '/README.txt', $text); } diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 54b038b6b..ec97db2dc 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -580,20 +580,29 @@ function template_preprocess_datetime_wrapper(&$variables) { * * Default template: links.html.twig. * + * Unfortunately links templates duplicate the "active" class handling of l() + * and LinkGenerator::generate() because it needs to be able to set the "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 it contains a certain element with a certain + * class. I.e. we cannot yet convert this jQuery selector to a CSS selector: + * jQuery('li:has("a.is-active")') + * * @param array $variables * An associative array containing: * - links: An array of links to be themed. Each link should be itself an * array, with the following elements: * - title: The link text. - * - url: (optional) The url object to link to. If omitted, no a tag is - * printed out. + * - url: (optional) The \Drupal\Core\Url object to link to. If omitted, no + * anchor tag is printed out. * - attributes: (optional) Attributes for the anchor, or for the * tag used in its place if no 'href' is supplied. If element 'class' is * included, it must be an array of one or more class names. * If the 'href' element is supplied, the entire link array is passed to * l() as its $options parameter. - * - attributes: A keyed array of attributes for the UL containing the - * list of links. + * - attributes: A keyed array of attributes for the