diff -u b/composer.json b/composer.json
--- b/composer.json
+++ b/composer.json
@@ -2,23 +2,48 @@
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
- "type": "project",
+ "type": "drupal-core",
"license": "GPL-2.0+",
"require": {
- "drupal/core": "~8.0"
+ "php": ">=5.4.5",
+ "sdboyer/gliph": "0.1.*",
+ "symfony/class-loader": "2.6.*",
+ "symfony/css-selector": "2.6.*",
+ "symfony/dependency-injection": "2.6.*",
+ "symfony/event-dispatcher": "2.6.*",
+ "symfony/http-foundation": "2.6.*",
+ "symfony/http-kernel": "2.6.*",
+ "symfony/routing": "2.6.*",
+ "symfony/serializer": "2.6.*",
+ "symfony/validator": "2.6.*",
+ "symfony/process": "2.6.*",
+ "symfony/yaml": "2.6.*",
+ "twig/twig": "1.16.*",
+ "doctrine/common": "dev-master#a45d110f71c323e29f41eb0696fa230e3fa1b1b5",
+ "doctrine/annotations": "1.2.*",
+ "guzzlehttp/guzzle": "~5.0",
+ "symfony-cmf/routing": "1.3.*",
+ "easyrdf/easyrdf": "0.9.*",
+ "phpunit/phpunit": "4.1.*",
+ "phpunit/phpunit-mock-objects": "dev-master#e60bb929c50ae4237aaf680a4f6773f4ee17f0a2",
+ "zendframework/zend-feed": "2.3.*",
+ "mikey179/vfsStream": "1.*",
+ "stack/builder": "1.0.*",
+ "egulias/email-validator": "1.2.*",
+ "masterminds/html5": "dev-master"
+ },
+ "autoload": {
+ "psr-4": {
+ "Drupal\\Core\\": "core/lib/Drupal/Core",
+ "Drupal\\Component\\": "core/lib/Drupal/Component",
+ "Drupal\\Driver\\": "drivers/lib/Drupal/Driver"
+ },
+ "files": [
+ "core/lib/Drupal.php"
+ ]
},
- "minimum-stability": "dev",
- "prefer-stable": true,
- "repositories": [],
"config": {
+ "vendor-dir": "core/vendor",
"preferred-install": "dist",
"autoloader-suffix": "Drupal8"
- },
- "extra": {
- "_readme": [
- "This is an example file to show how a Drupal website can be managed via",
- "Composer. It does not work out of the box but requires a Git subtree",
- "split of the core directory to be added to the repositories",
- "section above."
- ]
}
}
@@ -28,8 +53,7 @@
"zendframework/zend-feed": "2.3.*",
"mikey179/vfsStream": "1.*",
"stack/builder": "1.0.*",
- "egulias/email-validator": "1.2.*",
- "masterminds/html5": "dev-master"
+ "egulias/email-validator": "1.2.*"
},
"autoload": {
"psr-4": {
reverted:
--- b/composer.lock
+++ a/composer.lock
@@ -729,71 +729,6 @@
"time": "2014-10-12 19:18:40"
},
{
- "name": "masterminds/html5",
- "version": "dev-master",
- "source": {
- "type": "git",
- "url": "https://github.com/Masterminds/html5-php.git",
- "reference": "398ebb68c9395a67858d230d0610aa3676bebdc7"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/398ebb68c9395a67858d230d0610aa3676bebdc7",
- "reference": "398ebb68c9395a67858d230d0610aa3676bebdc7",
- "shasum": ""
- },
- "require": {
- "ext-libxml": "*",
- "php": ">=5.3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "4.*",
- "sami/sami": "~2.0",
- "satooshi/php-coveralls": "0.6.*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Masterminds\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Matt Butcher",
- "email": "technosophos@gmail.com"
- },
- {
- "name": "Asmir Mustafic",
- "email": "goetas@gmail.com"
- },
- {
- "name": "Matt Farina",
- "email": "matt@mattfarina.com"
- }
- ],
- "description": "An HTML5 parser and serializer.",
- "homepage": "http://masterminds.github.io/html5-php",
- "keywords": [
- "HTML5",
- "dom",
- "html",
- "parser",
- "querypath",
- "serializer",
- "xml"
- ],
- "time": "2014-12-02 02:51:14"
- },
- {
"name": "mikey179/vfsStream",
"version": "v1.4.0",
"source": {
@@ -2659,8 +2594,7 @@
"minimum-stability": "stable",
"stability-flags": {
"doctrine/common": 20,
+ "phpunit/phpunit-mock-objects": 20
- "phpunit/phpunit-mock-objects": 20,
- "masterminds/html5": 20
},
"prefer-stable": false,
"prefer-lowest": false,
diff -u b/core/vendor/composer/autoload_psr4.php b/core/vendor/composer/autoload_psr4.php
--- b/core/vendor/composer/autoload_psr4.php
+++ b/core/vendor/composer/autoload_psr4.php
@@ -3,7 +3,7 @@
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
-$baseDir = dirname($vendorDir);
+$baseDir = dirname(dirname($vendorDir));
return array(
'Symfony\\Cmf\\Component\\Routing\\' => array($vendorDir . '/symfony-cmf/routing'),
@@ -14,5 +14,5 @@
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
- 'Drupal\\Driver\\' => array($baseDir . '/../drivers/lib/Drupal/Driver'),
- 'Drupal\\Core\\' => array($baseDir . '/lib/Drupal/Core'),
- 'Drupal\\Component\\' => array($baseDir . '/lib/Drupal/Component'),
+ 'Drupal\\Driver\\' => array($baseDir . '/drivers/lib/Drupal/Driver'),
+ 'Drupal\\Core\\' => array($baseDir . '/core/lib/Drupal/Core'),
+ 'Drupal\\Component\\' => array($baseDir . '/core/lib/Drupal/Component'),
);
only in patch2:
unchanged:
--- a/core/composer.lock
+++ b/composer.lock
@@ -729,6 +729,71 @@
"time": "2014-10-12 19:18:40"
},
{
+ "name": "masterminds/html5",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Masterminds/html5-php.git",
+ "reference": "398ebb68c9395a67858d230d0610aa3676bebdc7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/398ebb68c9395a67858d230d0610aa3676bebdc7",
+ "reference": "398ebb68c9395a67858d230d0610aa3676bebdc7",
+ "shasum": ""
+ },
+ "require": {
+ "ext-libxml": "*",
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*",
+ "sami/sami": "~2.0",
+ "satooshi/php-coveralls": "0.6.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Masterminds\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Matt Butcher",
+ "email": "technosophos@gmail.com"
+ },
+ {
+ "name": "Asmir Mustafic",
+ "email": "goetas@gmail.com"
+ },
+ {
+ "name": "Matt Farina",
+ "email": "matt@mattfarina.com"
+ }
+ ],
+ "description": "An HTML5 parser and serializer.",
+ "homepage": "http://masterminds.github.io/html5-php",
+ "keywords": [
+ "HTML5",
+ "dom",
+ "html",
+ "parser",
+ "querypath",
+ "serializer",
+ "xml"
+ ],
+ "time": "2014-12-02 02:51:14"
+ },
+ {
"name": "mikey179/vfsStream",
"version": "v1.4.0",
"source": {
@@ -2594,7 +2659,8 @@
"minimum-stability": "stable",
"stability-flags": {
"doctrine/common": 20,
- "phpunit/phpunit-mock-objects": 20
+ "phpunit/phpunit-mock-objects": 20,
+ "masterminds/html5": 20
},
"prefer-stable": false,
"prefer-lowest": false,
only in patch2:
unchanged:
--- a/core/UPGRADE.txt
+++ b/core/UPGRADE.txt
@@ -58,9 +58,8 @@ following the instructions in the INTRODUCTION section at the top of this file:
3. Remove all old core files and directories, except for the 'sites' directory
and any custom files you added elsewhere.
- If you made modifications to files like .htaccess, composer.json, or
- robots.txt you will need to re-apply them from your backup, after the new
- files are in place.
+ If you made modifications to files like .htaccess or robots.txt, you will
+ need to re-apply them from your backup, after the new files are in place.
Sometimes an update includes changes to default.settings.php (this will be
noted in the release notes). If that's the case, follow these steps:
@@ -94,8 +93,7 @@ following the instructions in the INTRODUCTION section at the top of this file:
from http://drupal.org using your web browser, extract it, and then use an
FTP client to upload the files to your web root.
-5. Re-apply any modifications to files such as .htaccess, composer.json, or
- robots.txt.
+5. Re-apply any modifications to files such as .htaccess or robots.txt.
6. Run update.php by visiting http://www.example.com/update.php (replace
www.example.com with your domain name). This will update the core database
only in patch2:
unchanged:
--- /dev/null
+++ b/core/assets/vendor/jquery-joyride/jquery.joyride-2.0.3.js
@@ -0,0 +1,675 @@
+/*
+ * jQuery Foundation Joyride Plugin 2.0.3
+ * http://foundation.zurb.com
+ * Copyright 2012, ZURB
+ * Free to use under the MIT license.
+ * http://www.opensource.org/licenses/mit-license.php
+*/
+
+/*jslint unparam: true, browser: true, indent: 2 */
+
+;(function ($, window, undefined) {
+ 'use strict';
+
+ var defaults = {
+ 'version' : '2.0.3',
+ 'tipLocation' : 'bottom', // 'top' or 'bottom' in relation to parent
+ 'nubPosition' : 'auto', // override on a per tooltip bases
+ 'scrollSpeed' : 300, // Page scrolling speed in milliseconds
+ 'timer' : 0, // 0 = no timer , all other numbers = timer in milliseconds
+ 'startTimerOnClick' : true, // true or false - true requires clicking the first button start the timer
+ 'startOffset' : 0, // the index of the tooltip you want to start on (index of the li)
+ 'nextButton' : true, // true or false to control whether a next button is used
+ 'tipAnimation' : 'fade', // 'pop' or 'fade' in each tip
+ 'pauseAfter' : [], // array of indexes where to pause the tour after
+ 'tipAnimationFadeSpeed': 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition
+ 'cookieMonster' : false, // true or false to control whether cookies are used
+ 'cookieName' : 'joyride', // Name the cookie you'll use
+ 'cookieDomain' : false, // Will this cookie be attached to a domain, ie. '.notableapp.com'
+ 'tipContainer' : 'body', // Where will the tip be attached
+ 'postRideCallback' : $.noop, // A method to call once the tour closes (canceled or complete)
+ 'postStepCallback' : $.noop, // A method to call after each step
+ 'template' : { // HTML segments for tip layout
+ 'link' : 'X',
+ 'timer' : '
',
+ 'tip' : '
',
+ 'wrapper' : '',
+ 'button' : ''
+ }
+ },
+
+ Modernizr = Modernizr || false,
+
+ settings = {},
+
+ methods = {
+
+ init : function (opts) {
+ return this.each(function () {
+
+ if ($.isEmptyObject(settings)) {
+ settings = $.extend(true, defaults, opts);
+
+ // non configurable settings
+ settings.document = window.document;
+ settings.$document = $(settings.document);
+ settings.$window = $(window);
+ settings.$content_el = $(this);
+ settings.body_offset = $(settings.tipContainer).position();
+ settings.$tip_content = $('> li', settings.$content_el);
+ settings.paused = false;
+ settings.attempts = 0;
+
+ settings.tipLocationPatterns = {
+ top: ['bottom'],
+ bottom: [], // bottom should not need to be repositioned
+ left: ['right', 'top', 'bottom'],
+ right: ['left', 'top', 'bottom']
+ };
+
+ // are we using jQuery 1.7+
+ methods.jquery_check();
+
+ // can we create cookies?
+ if (!$.isFunction($.cookie)) {
+ settings.cookieMonster = false;
+ }
+
+ // generate the tips and insert into dom.
+ if (!settings.cookieMonster || !$.cookie(settings.cookieName)) {
+
+ settings.$tip_content.each(function (index) {
+ methods.create({$li : $(this), index : index});
+ });
+
+ // show first tip
+ if (!settings.startTimerOnClick && settings.timer > 0) {
+ methods.show('init');
+ methods.startTimer();
+ } else {
+ methods.show('init');
+ }
+
+ }
+
+ settings.$document.on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
+ e.preventDefault();
+
+ if (settings.$li.next().length < 1) {
+ methods.end();
+ } else if (settings.timer > 0) {
+ clearTimeout(settings.automate);
+ methods.hide();
+ methods.show();
+ methods.startTimer();
+ } else {
+ methods.hide();
+ methods.show();
+ }
+
+ });
+
+ settings.$document.on('click.joyride', '.joyride-close-tip', function (e) {
+ e.preventDefault();
+ methods.end();
+ });
+
+ settings.$window.bind('resize.joyride', function (e) {
+ if (methods.is_phone()) {
+ methods.pos_phone();
+ } else {
+ methods.pos_default();
+ }
+ });
+ } else {
+ methods.restart();
+ }
+
+ });
+ },
+
+ // call this method when you want to resume the tour
+ resume : function () {
+ methods.set_li();
+ methods.show();
+ },
+
+ tip_template : function (opts) {
+ var $blank, content, $wrapper;
+
+ opts.tip_class = opts.tip_class || '';
+
+ $blank = $(settings.template.tip).addClass(opts.tip_class);
+ content = $.trim($(opts.li).html()) +
+ methods.button_text(opts.button_text) +
+ settings.template.link +
+ methods.timer_instance(opts.index);
+
+ $wrapper = $(settings.template.wrapper);
+ if (opts.li.attr('data-aria-labelledby')) {
+ $wrapper.attr('aria-labelledby', opts.li.attr('data-aria-labelledby'))
+ }
+ if (opts.li.attr('data-aria-describedby')) {
+ $wrapper.attr('aria-describedby', opts.li.attr('data-aria-describedby'))
+ }
+ $blank.append($wrapper);
+ $blank.first().attr('data-index', opts.index);
+ $('.joyride-content-wrapper', $blank).append(content);
+
+ return $blank[0];
+ },
+
+ timer_instance : function (index) {
+ var txt;
+
+ if ((index === 0 && settings.startTimerOnClick && settings.timer > 0) || settings.timer === 0) {
+ txt = '';
+ } else {
+ txt = methods.outerHTML($(settings.template.timer)[0]);
+ }
+ return txt;
+ },
+
+ button_text : function (txt) {
+ if (settings.nextButton) {
+ txt = $.trim(txt) || 'Next';
+ txt = methods.outerHTML($(settings.template.button).append(txt)[0]);
+ } else {
+ txt = '';
+ }
+ return txt;
+ },
+
+ create : function (opts) {
+ // backwards compatibility with data-text attribute
+ var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
+ tipClass = opts.$li.attr('class'),
+ $tip_content = $(methods.tip_template({
+ tip_class : tipClass,
+ index : opts.index,
+ button_text : buttonText,
+ li : opts.$li
+ }));
+
+ $(settings.tipContainer).append($tip_content);
+ },
+
+ show : function (init) {
+ var opts = {}, ii, opts_arr = [], opts_len = 0, p,
+ $timer = null;
+
+ // are we paused?
+ if (settings.$li === undefined || ($.inArray(settings.$li.index(), settings.pauseAfter) === -1)) {
+
+ // don't go to the next li if the tour was paused
+ if (settings.paused) {
+ settings.paused = false;
+ } else {
+ methods.set_li(init);
+ }
+
+ settings.attempts = 0;
+
+ if (settings.$li.length && settings.$target.length > 0) {
+ opts_arr = (settings.$li.data('options') || ':').split(';');
+ opts_len = opts_arr.length;
+
+ // parse options
+ for (ii = opts_len - 1; ii >= 0; ii--) {
+ p = opts_arr[ii].split(':');
+
+ if (p.length === 2) {
+ opts[$.trim(p[0])] = $.trim(p[1]);
+ }
+ }
+
+ settings.tipSettings = $.extend({}, settings, opts);
+
+ settings.tipSettings.tipLocationPattern = settings.tipLocationPatterns[settings.tipSettings.tipLocation];
+
+ // scroll if not modal
+ if (!/body/i.test(settings.$target.selector)) {
+ methods.scroll_to();
+ }
+
+ if (methods.is_phone()) {
+ methods.pos_phone(true);
+ } else {
+ methods.pos_default(true);
+ }
+
+ $timer = $('.joyride-timer-indicator', settings.$next_tip);
+
+ if (/pop/i.test(settings.tipAnimation)) {
+
+ $timer.outerWidth(0);
+
+ if (settings.timer > 0) {
+
+ settings.$next_tip.show();
+ $timer.animate({
+ width: $('.joyride-timer-indicator-wrap', settings.$next_tip).outerWidth()
+ }, settings.timer);
+
+ } else {
+
+ settings.$next_tip.show();
+
+ }
+
+
+ } else if (/fade/i.test(settings.tipAnimation)) {
+
+ $timer.outerWidth(0);
+
+ if (settings.timer > 0) {
+
+ settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
+
+ settings.$next_tip.show();
+ $timer.animate({
+ width: $('.joyride-timer-indicator-wrap', settings.$next_tip).outerWidth()
+ }, settings.timer);
+
+ } else {
+
+ settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
+
+ }
+ }
+
+ settings.$current_tip = settings.$next_tip;
+ $('.joyride-next-tip', settings.$current_tip).focus();
+ methods.tabbable(settings.$current_tip);
+
+ // skip non-existent targets
+ } else if (settings.$li && settings.$target.length < 1) {
+
+ methods.show();
+
+ } else {
+
+ methods.end();
+
+ }
+ } else {
+
+ settings.paused = true;
+
+ }
+
+ },
+
+ // detect phones with media queries if supported.
+ is_phone : function () {
+ if (Modernizr) {
+ return Modernizr.mq('only screen and (max-width: 767px)');
+ }
+
+ return (settings.$window.width() < 767) ? true : false;
+ },
+
+ hide : function () {
+ settings.postStepCallback(settings.$li.index(), settings.$current_tip);
+ $('.joyride-modal-bg').hide();
+ settings.$current_tip.hide();
+ },
+
+ set_li : function (init) {
+ if (init) {
+ settings.$li = settings.$tip_content.eq(settings.startOffset);
+ methods.set_next_tip();
+ settings.$current_tip = settings.$next_tip;
+ } else {
+ settings.$li = settings.$li.next();
+ methods.set_next_tip();
+ }
+
+ methods.set_target();
+ },
+
+ set_next_tip : function () {
+ settings.$next_tip = $('.joyride-tip-guide[data-index=' + settings.$li.index() + ']');
+ },
+
+ set_target : function () {
+ var cl = settings.$li.attr('data-class'),
+ id = settings.$li.attr('data-id'),
+ $sel = function () {
+ if (id) {
+ return $(settings.document.getElementById(id));
+ } else if (cl) {
+ return $('.' + cl).first();
+ } else {
+ return $('body');
+ }
+ };
+
+ settings.$target = $sel();
+ },
+
+ scroll_to : function () {
+ var window_half, tipOffset;
+
+ window_half = settings.$window.height() / 2;
+ tipOffset = Math.ceil(settings.$target.offset().top - window_half + settings.$next_tip.outerHeight());
+
+ $("html, body").stop().animate({
+ scrollTop: tipOffset
+ }, settings.scrollSpeed);
+ },
+
+ paused : function () {
+ if (($.inArray((settings.$li.index() + 1), settings.pauseAfter) === -1)) {
+ return true;
+ }
+
+ return false;
+ },
+
+ destroy : function () {
+ settings.$document.off('.joyride');
+ $(window).off('.joyride');
+ $('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride');
+ $('.joyride-tip-guide, .joyride-modal-bg').remove();
+ clearTimeout(settings.automate);
+ settings = {};
+ },
+
+ restart : function () {
+ methods.hide();
+ settings.$li = undefined;
+ methods.show('init');
+ },
+
+ pos_default : function (init) {
+ var half_fold = Math.ceil(settings.$window.height() / 2),
+ tip_position = settings.$next_tip.offset(),
+ $nub = $('.joyride-nub', settings.$next_tip),
+ nub_height = Math.ceil($nub.outerHeight() / 2),
+ toggle = init || false;
+
+ // tip must not be "display: none" to calculate position
+ if (toggle) {
+ settings.$next_tip.css('visibility', 'hidden');
+ settings.$next_tip.show();
+ }
+
+ if (!/body/i.test(settings.$target.selector)) {
+
+ if (methods.bottom()) {
+ settings.$next_tip.css({
+ top: (settings.$target.offset().top + nub_height + settings.$target.outerHeight()),
+ left: settings.$target.offset().left});
+
+ methods.nub_position($nub, settings.tipSettings.nubPosition, 'top');
+
+ } else if (methods.top()) {
+
+ settings.$next_tip.css({
+ top: (settings.$target.offset().top - settings.$next_tip.outerHeight() - nub_height),
+ left: settings.$target.offset().left});
+
+ methods.nub_position($nub, settings.tipSettings.nubPosition, 'bottom');
+
+ } else if (methods.right()) {
+
+ settings.$next_tip.css({
+ top: settings.$target.offset().top,
+ left: (settings.$target.outerWidth() + settings.$target.offset().left)});
+
+ methods.nub_position($nub, settings.tipSettings.nubPosition, 'left');
+
+ } else if (methods.left()) {
+
+ settings.$next_tip.css({
+ top: settings.$target.offset().top,
+ left: (settings.$target.offset().left - settings.$next_tip.outerWidth() - nub_height)});
+
+ methods.nub_position($nub, settings.tipSettings.nubPosition, 'right');
+
+ }
+
+ if (!methods.visible(methods.corners(settings.$next_tip)) && settings.attempts < settings.tipSettings.tipLocationPattern.length) {
+
+ $nub.removeClass('bottom')
+ .removeClass('top')
+ .removeClass('right')
+ .removeClass('left');
+
+ settings.tipSettings.tipLocation = settings.tipSettings.tipLocationPattern[settings.attempts];
+
+ settings.attempts++;
+
+ methods.pos_default(true);
+
+ }
+
+ } else if (settings.$li.length) {
+
+ methods.pos_modal($nub);
+
+ }
+
+ if (toggle) {
+ settings.$next_tip.hide();
+ settings.$next_tip.css('visibility', 'visible');
+ }
+
+ },
+
+ pos_phone : function (init) {
+ var tip_height = settings.$next_tip.outerHeight(),
+ tip_offset = settings.$next_tip.offset(),
+ target_height = settings.$target.outerHeight(),
+ $nub = $('.joyride-nub', settings.$next_tip),
+ nub_height = Math.ceil($nub.outerHeight() / 2),
+ toggle = init || false;
+
+ $nub.removeClass('bottom')
+ .removeClass('top')
+ .removeClass('right')
+ .removeClass('left');
+
+ if (toggle) {
+ settings.$next_tip.css('visibility', 'hidden');
+ settings.$next_tip.show();
+ }
+
+ if (!/body/i.test(settings.$target.selector)) {
+
+ if (methods.top()) {
+
+ settings.$next_tip.offset({top: settings.$target.offset().top - tip_height - nub_height});
+ $nub.addClass('bottom');
+
+ } else {
+
+ settings.$next_tip.offset({top: settings.$target.offset().top + target_height + nub_height});
+ $nub.addClass('top');
+
+ }
+
+ } else if (settings.$li.length) {
+
+ methods.pos_modal($nub);
+
+ }
+
+ if (toggle) {
+ settings.$next_tip.hide();
+ settings.$next_tip.css('visibility', 'visible');
+ }
+ },
+
+ pos_modal : function ($nub) {
+ methods.center();
+ $nub.hide();
+
+ if ($('.joyride-modal-bg').length < 1) {
+ $('body').append('').show();
+ }
+
+ if (/pop/i.test(settings.tipAnimation)) {
+ $('.joyride-modal-bg').show();
+ } else {
+ $('.joyride-modal-bg').fadeIn(settings.tipAnimationFadeSpeed);
+ }
+ },
+
+ center : function () {
+ var $w = settings.$window;
+
+ settings.$next_tip.css({
+ top : ((($w.height() - settings.$next_tip.outerHeight()) / 2) + $w.scrollTop()),
+ left : ((($w.width() - settings.$next_tip.outerWidth()) / 2) + $w.scrollLeft())
+ });
+
+ return true;
+ },
+
+ bottom : function () {
+ return /bottom/i.test(settings.tipSettings.tipLocation);
+ },
+
+ top : function () {
+ return /top/i.test(settings.tipSettings.tipLocation);
+ },
+
+ right : function () {
+ return /right/i.test(settings.tipSettings.tipLocation);
+ },
+
+ left : function () {
+ return /left/i.test(settings.tipSettings.tipLocation);
+ },
+
+ corners : function (el) {
+ var w = settings.$window,
+ right = w.width() + w.scrollLeft(),
+ bottom = w.width() + w.scrollTop();
+
+ return [
+ el.offset().top <= w.scrollTop(),
+ right <= el.offset().left + el.outerWidth(),
+ bottom <= el.offset().top + el.outerHeight(),
+ w.scrollLeft() >= el.offset().left
+ ];
+ },
+
+ visible : function (hidden_corners) {
+ var i = hidden_corners.length;
+
+ while (i--) {
+ if (hidden_corners[i]) return false;
+ }
+
+ return true;
+ },
+
+ nub_position : function (nub, pos, def) {
+ if (pos === 'auto') {
+ nub.addClass(def);
+ } else {
+ nub.addClass(pos);
+ }
+ },
+
+ startTimer : function () {
+ if (settings.$li.length) {
+ settings.automate = setTimeout(function () {
+ methods.hide();
+ methods.show();
+ methods.startTimer();
+ }, settings.timer);
+ } else {
+ clearTimeout(settings.automate);
+ }
+ },
+
+ end : function () {
+ if (settings.cookieMonster) {
+ $.cookie(settings.cookieName, 'ridden', { expires: 365, domain: settings.cookieDomain });
+ }
+
+ if (settings.timer > 0) {
+ clearTimeout(settings.automate);
+ }
+
+ $('.joyride-modal-bg').hide();
+ settings.$current_tip.hide();
+ settings.postStepCallback(settings.$li.index(), settings.$current_tip);
+ settings.postRideCallback(settings.$li.index(), settings.$current_tip);
+ },
+
+ jquery_check : function () {
+ // define on() and off() for older jQuery
+ if (!$.isFunction($.fn.on)) {
+
+ $.fn.on = function (types, sel, fn) {
+
+ return this.delegate(sel, types, fn);
+
+ };
+
+ $.fn.off = function (types, sel, fn) {
+
+ return this.undelegate(sel, types, fn);
+
+ };
+
+ return false;
+ }
+
+ return true;
+ },
+
+ outerHTML : function (el) {
+ // support FireFox < 11
+ return el.outerHTML || new XMLSerializer().serializeToString(el);
+ },
+
+ version : function () {
+ return settings.version;
+ },
+
+ tabbable : function (el) {
+ $(el).on('keydown', function( event ) {
+ if (!event.isDefaultPrevented() && event.keyCode &&
+ // Escape key.
+ event.keyCode === 27 ) {
+ event.preventDefault();
+ methods.end();
+ return;
+ }
+
+ // Prevent tabbing out of tour items.
+ if ( event.keyCode !== 9 ) {
+ return;
+ }
+ var tabbables = $(el).find(":tabbable"),
+ first = tabbables.filter(":first"),
+ last = tabbables.filter(":last");
+ if ( event.target === last[0] && !event.shiftKey ) {
+ first.focus( 1 );
+ event.preventDefault();
+ } else if ( event.target === first[0] && event.shiftKey ) {
+ last.focus( 1 );
+ event.preventDefault();
+ }
+ });
+ }
+
+ };
+
+ $.fn.joyride = function (method) {
+ if (methods[method]) {
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+ } else if (typeof method === 'object' || !method) {
+ return methods.init.apply(this, arguments);
+ } else {
+ $.error('Method ' + method + ' does not exist on jQuery.joyride');
+ }
+ };
+
+}(jQuery, this));
only in patch2:
unchanged:
--- a/core/assets/vendor/jquery-joyride/jquery.joyride-2.1.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/* jQuery Foundation Joyride Plugin 2.1 | Copyright 2012, ZURB | www.opensource.org/licenses/mit-license.php */
-(function(e,t,n){"use strict";var r={version:"2.0.3",tipLocation:"bottom",nubPosition:"auto",scroll:!0,scrollSpeed:300,timer:0,autoStart:!1,startTimerOnClick:!0,startOffset:0,nextButton:!0,tipAnimation:"fade",pauseAfter:[],tipAnimationFadeSpeed:300,cookieMonster:!1,cookieName:"joyride",cookieDomain:!1,cookiePath:!1,localStorage:!1,localStorageKey:"joyride",tipContainer:"body",modal:!1,expose:!1,postExposeCallback:e.noop,preRideCallback:e.noop,postRideCallback:e.noop,preStepCallback:e.noop,postStepCallback:e.noop,template:{link:'
X',timer:'
',tip:'
',wrapper:'
',button:'
',modal:'
',expose:'
',exposeCover:'
'}},i=i||!1,s={},o={init:function(n){return this.each(function(){e.isEmptyObject(s)?(s=e.extend(!0,r,n),s.document=t.document,s.$document=e(s.document),s.$window=e(t),s.$content_el=e(this),s.$body=e(s.tipContainer),s.body_offset=e(s.tipContainer).position(),s.$tip_content=e("> li",s.$content_el),s.paused=!1,s.attempts=0,s.tipLocationPatterns={top:["bottom"],bottom:[],left:["right","top","bottom"],right:["left","top","bottom"]},o.jquery_check(),e.isFunction(e.cookie)||(s.cookieMonster=!1),(!s.cookieMonster||!e.cookie(s.cookieName))&&(!s.localStorage||!o.support_localstorage()||!localStorage.getItem(s.localStorageKey))&&(s.$tip_content.each(function(t){o.create({$li:e(this),index:t})}),s.autoStart&&(!s.startTimerOnClick&&s.timer>0?(o.show("init"),o.startTimer()):o.show("init"))),s.$document.on("click.joyride",".joyride-next-tip, .joyride-modal-bg",function(e){e.preventDefault(),s.$li.next().length<1?o.end():s.timer>0?(clearTimeout(s.automate),o.hide(),o.show(),o.startTimer()):(o.hide(),o.show())}),s.$document.on("click.joyride",".joyride-close-tip",function(e){e.preventDefault(),o.end()}),s.$window.bind("resize.joyride",function(t){if(s.$li){if(s.exposed&&s.exposed.length>0){var n=e(s.exposed);n.each(function(){var t=e(this);o.un_expose(t),o.expose(t)})}o.is_phone()?o.pos_phone():o.pos_default()}})):o.restart()})},resume:function(){o.set_li(),o.show()},nextTip:function(){s.$li.next().length<1?o.end():s.timer>0?(clearTimeout(s.automate),o.hide(),o.show(),o.startTimer()):(o.hide(),o.show())},tip_template:function(t){var n,r,i;return t.tip_class=t.tip_class||"",n=e(s.template.tip).addClass(t.tip_class),r=e.trim(e(t.li).html())+o.button_text(t.button_text)+s.template.link+o.timer_instance(t.index),i=e(s.template.wrapper),t.li.attr("data-aria-labelledby")&&i.attr("aria-labelledby",t.li.attr("data-aria-labelledby")),t.li.attr("data-aria-describedby")&&i.attr("aria-describedby",t.li.attr("data-aria-describedby")),n.append(i),n.first().attr("data-index",t.index),e(".joyride-content-wrapper",n).append(r),n[0]},timer_instance:function(t){var n;return t===0&&s.startTimerOnClick&&s.timer>0||s.timer===0?n="":n=o.outerHTML(e(s.template.timer)[0]),n},button_text:function(t){return s.nextButton?(t=e.trim(t)||"Next",t=o.outerHTML(e(s.template.button).append(t)[0])):t="",t},create:function(t){var n=t.$li.attr("data-button")||t.$li.attr("data-text"),r=t.$li.attr("class"),i=e(o.tip_template({tip_class:r,index:t.index,button_text:n,li:t.$li}));e(s.tipContainer).append(i)},show:function(t){var r={},i,u=[],a=0,f,l=null;if(s.$li===n||e.inArray(s.$li.index(),s.pauseAfter)===-1){s.paused?s.paused=!1:o.set_li(t),s.attempts=0;if(s.$li.length&&s.$target.length>0){t&&(s.preRideCallback(s.$li.index(),s.$next_tip),s.modal&&o.show_modal()),s.preStepCallback(s.$li.index(),s.$next_tip),u=(s.$li.data("options")||":").split(";"),a=u.length;for(i=a-1;i>=0;i--)f=u[i].split(":"),f.length===2&&(r[e.trim(f[0])]=e.trim(f[1]));s.tipSettings=e.extend({},s,r),s.tipSettings.tipLocationPattern=s.tipLocationPatterns[s.tipSettings.tipLocation],s.modal&&s.expose&&o.expose(),!/body/i.test(s.$target.selector)&&s.scroll&&o.scroll_to(),o.is_phone()?o.pos_phone(!0):o.pos_default(!0),l=e(".joyride-timer-indicator",s.$next_tip),/pop/i.test(s.tipAnimation)?(l.outerWidth(0),s.timer>0?(s.$next_tip.show(),l.animate({width:e(".joyride-timer-indicator-wrap",s.$next_tip).outerWidth()},s.timer)):s.$next_tip.show()):/fade/i.test(s.tipAnimation)&&(l.outerWidth(0),s.timer>0?(s.$next_tip.fadeIn(s.tipAnimationFadeSpeed),s.$next_tip.show(),l.animate({width:e(".joyride-timer-indicator-wrap",s.$next_tip).outerWidth()},s.timer)):s.$next_tip.fadeIn(s.tipAnimationFadeSpeed)),s.$current_tip=s.$next_tip,e(".joyride-next-tip",s.$current_tip).focus(),o.tabbable(s.$current_tip)}else s.$li&&s.$target.length<1?o.show():o.end()}else s.paused=!0},is_phone:function(){return i?i.mq("only screen and (max-width: 767px)"):s.$window.width()<767?!0:!1},support_localstorage:function(){return i?i.localstorage:!!t.localStorage},hide:function(){s.modal&&s.expose&&o.un_expose(),s.modal||e(".joyride-modal-bg").hide(),s.$current_tip.hide(),s.postStepCallback(s.$li.index(),s.$current_tip)},set_li:function(e){e?(s.$li=s.$tip_content.eq(s.startOffset),o.set_next_tip(),s.$current_tip=s.$next_tip):(s.$li=s.$li.next(),o.set_next_tip()),o.set_target()},set_next_tip:function(){s.$next_tip=e(".joyride-tip-guide[data-index="+s.$li.index()+"]")},set_target:function(){var t=s.$li.attr("data-class"),n=s.$li.attr("data-id"),r=function(){return n?e(s.document.getElementById(n)):t?e("."+t).filter(":visible").first():e("body")};s.$target=r()},scroll_to:function(){var t,n;t=s.$window.height()/2,n=Math.ceil(s.$target.offset().top-t+s.$next_tip.outerHeight()),e("html, body").stop().animate({scrollTop:n},s.scrollSpeed)},paused:function(){return e.inArray(s.$li.index()+1,s.pauseAfter)===-1?!0:!1},destroy:function(){e.isEmptyObject(s)||s.$document.off(".joyride"),e(t).off(".joyride"),e(".joyride-close-tip, .joyride-next-tip, .joyride-modal-bg").off(".joyride"),e(".joyride-tip-guide, .joyride-modal-bg").remove(),clearTimeout(s.automate),s={}},restart:function(){s.autoStart?(o.hide(),s.$li=n,o.show("init")):(!s.startTimerOnClick&&s.timer>0?(o.show("init"),o.startTimer()):o.show("init"),s.autoStart=!0)},pos_default:function(t){var n=Math.ceil(s.$window.height()/2),r=s.$next_tip.offset(),i=e(".joyride-nub",s.$next_tip),u=Math.ceil(i.outerWidth()/2),a=Math.ceil(i.outerHeight()/2),f=t||!1;f&&(s.$next_tip.css("visibility","hidden"),s.$next_tip.show());if(!/body/i.test(s.$target.selector)){var l=s.tipSettings.tipAdjustmentY?parseInt(s.tipSettings.tipAdjustmentY):0,c=s.tipSettings.tipAdjustmentX?parseInt(s.tipSettings.tipAdjustmentX):0;o.bottom()?(s.$next_tip.css({top:s.$target.offset().top+a+s.$target.outerHeight()+l,left:s.$target.offset().left+c}),/right/i.test(s.tipSettings.nubPosition)&&s.$next_tip.css("left",s.$target.offset().left-s.$next_tip.outerWidth()+s.$target.outerWidth()),o.nub_position(i,s.tipSettings.nubPosition,"top")):o.top()?(s.$next_tip.css({top:s.$target.offset().top-s.$next_tip.outerHeight()-a+l,left:s.$target.offset().left+c}),o.nub_position(i,s.tipSettings.nubPosition,"bottom")):o.right()?(s.$next_tip.css({top:s.$target.offset().top+l,left:s.$target.outerWidth()+s.$target.offset().left+u+c}),o.nub_position(i,s.tipSettings.nubPosition,"left")):o.left()&&(s.$next_tip.css({top:s.$target.offset().top+l,left:s.$target.offset().left-s.$next_tip.outerWidth()-u+c}),o.nub_position(i,s.tipSettings.nubPosition,"right")),!o.visible(o.corners(s.$next_tip))&&s.attempts
0&&arguments[0]instanceof e)i=arguments[0];else{if(!s.$target||!!/body/i.test(s.$target.selector))return!1;i=s.$target}if(i.length<1)return t.console&&console.error("element not valid",i),!1;n=e(s.template.expose),s.$body.append(n),n.css({top:i.offset().top,left:i.offset().left,width:i.outerWidth(!0),height:i.outerHeight(!0)}),r=e(s.template.exposeCover),u={zIndex:i.css("z-index"),position:i.css("position")},i.css("z-index",n.css("z-index")*1+1),u.position=="static"&&i.css("position","relative"),i.data("expose-css",u),r.css({top:i.offset().top,left:i.offset().left,width:i.outerWidth(!0),height:i.outerHeight(!0)}),s.$body.append(r),n.addClass(a),r.addClass(a),s.tipSettings.exposeClass&&(n.addClass(s.tipSettings.exposeClass),r.addClass(s.tipSettings.exposeClass)),i.data("expose",a),s.postExposeCallback(s.$li.index(),s.$next_tip,i),o.add_exposed(i)},un_expose:function(){var n,r,i,u,a=!1;if(arguments.length>0&&arguments[0]instanceof e)r=arguments[0];else{if(!s.$target||!!/body/i.test(s.$target.selector))return!1;r=s.$target}if(r.length<1)return t.console&&console.error("element not valid",r),!1;n=r.data("expose"),i=e("."+n),arguments.length>1&&(a=arguments[1]),a===!0?e(".joyride-expose-wrapper,.joyride-expose-cover").remove():i.remove(),u=r.data("expose-css"),u.zIndex=="auto"?r.css("z-index",""):r.css("z-index",u.zIndex),u.position!=r.css("position")&&(u.position=="static"?r.css("position",""):r.css("position",u.position)),r.removeData("expose"),r.removeData("expose-z-index"),o.remove_exposed(r)},add_exposed:function(t){s.exposed=s.exposed||[],t instanceof e?s.exposed.push(t[0]):typeof t=="string"&&s.exposed.push(t)},remove_exposed:function(t){var n;t instanceof e?n=t[0]:typeof t=="string"&&(n=t),s.exposed=s.exposed||[];for(var r=0;ru&&(u=o),[e.offset().tope.offset().left]},visible:function(e){var t=e.length;while(t--)if(e[t])return!1;return!0},nub_position:function(e,t,n){t==="auto"?e.addClass(n):e.addClass(t)},startTimer:function(){s.$li.length?s.automate=setTimeout(function(){o.hide(),o.show(),o.startTimer()},s.timer):clearTimeout(s.automate)},end:function(){s.cookieMonster&&e.cookie(s.cookieName,"ridden",{expires:365,domain:s.cookieDomain,path:s.cookiePath}),s.localStorage&&localStorage.setItem(s.localStorageKey,!0),s.timer>0&&clearTimeout(s.automate),s.modal&&s.expose&&o.un_expose(),s.$current_tip&&s.$current_tip.hide(),s.$li&&(s.postStepCallback(s.$li.index(),s.$current_tip),s.postRideCallback(s.$li.index(),s.$current_tip)),e(".joyride-modal-bg").hide()},jquery_check:function(){return e.isFunction(e.fn.on)?!0:(e.fn.on=function(e,t,n){return this.delegate(t,e,n)},e.fn.off=function(e,t,n){return this.undelegate(t,e,n)},!1)},outerHTML:function(e){return e.outerHTML||(new XMLSerializer).serializeToString(e)},version:function(){return s.version},tabbable:function(t){e(t).on("keydown",function(n){if(!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===27){n.preventDefault(),o.end();return}if(n.keyCode!==9)return;var r=e(t).find(":tabbable"),i=r.filter(":first"),s=r.filter(":last");n.target===s[0]&&!n.shiftKey?(i.focus(1),n.preventDefault()):n.target===i[0]&&n.shiftKey&&(s.focus(1),n.preventDefault())})}};e.fn.joyride=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.joyride")}})(jQuery,this);
only in patch2:
unchanged:
--- a/core/composer.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "name": "drupal/core",
- "description": "Drupal is an open source content management platform powering millions of websites and applications.",
- "type": "drupal-core",
- "license": "GPL-2.0+",
- "require": {
- "php": ">=5.4.5",
- "sdboyer/gliph": "0.1.*",
- "symfony/class-loader": "2.6.*",
- "symfony/css-selector": "2.6.*",
- "symfony/dependency-injection": "2.6.*",
- "symfony/event-dispatcher": "2.6.*",
- "symfony/http-foundation": "2.6.*",
- "symfony/http-kernel": "2.6.*",
- "symfony/routing": "2.6.*",
- "symfony/serializer": "2.6.*",
- "symfony/validator": "2.6.*",
- "symfony/process": "2.6.*",
- "symfony/yaml": "2.6.*",
- "twig/twig": "1.16.*",
- "doctrine/common": "dev-master#a45d110f71c323e29f41eb0696fa230e3fa1b1b5",
- "doctrine/annotations": "1.2.*",
- "guzzlehttp/guzzle": "~5.0",
- "symfony-cmf/routing": "1.3.*",
- "easyrdf/easyrdf": "0.9.*",
- "phpunit/phpunit": "4.1.*",
- "phpunit/phpunit-mock-objects": "dev-master#e60bb929c50ae4237aaf680a4f6773f4ee17f0a2",
- "zendframework/zend-feed": "2.3.*",
- "mikey179/vfsStream": "1.*",
- "stack/builder": "1.0.*",
- "egulias/email-validator": "1.2.*"
- },
- "autoload": {
- "psr-4": {
- "Drupal\\Core\\": "lib/Drupal/Core",
- "Drupal\\Component\\": "lib/Drupal/Component",
- "Drupal\\Driver\\": "../drivers/lib/Drupal/Driver"
- },
- "files": [
- "lib/Drupal.php"
- ]
- },
- "config": {
- "preferred-install": "dist",
- "autoloader-suffix": "Drupal8"
- }
-}
only in patch2:
unchanged:
--- a/core/config/schema/core.entity.schema.yml
+++ b/core/config/schema/core.entity.schema.yml
@@ -79,17 +79,17 @@ core.entity_view_display.*.*.*:
weight:
type: integer
label: 'Weight'
+ third_party_settings:
+ type: sequence
+ label: 'Third party settings'
+ sequence:
+ - type: entity_view_display.third_party.[%key]
label:
type: string
label: 'Label setting machine name'
settings:
type: field.formatter.settings.[%parent.type]
label: 'Settings'
- third_party_settings:
- type: sequence
- label: 'Third party settings'
- sequence:
- - type: field.formatter.third_party.[%key]
hidden:
type: sequence
label: 'Field display setting'
@@ -135,14 +135,14 @@ core.entity_form_display.*.*.*:
weight:
type: integer
label: 'Weight'
- settings:
- type: field.widget.settings.[%parent.type]
- label: 'Settings'
third_party_settings:
type: sequence
label: 'Third party settings'
sequence:
- - type: field.widget.third_party.[%key]
+ - type: entity_form_display.third_party.[%key]
+ settings:
+ type: field.widget.settings.[%parent.type]
+ label: 'Settings'
hidden:
type: sequence
label: 'Hidden'
only in patch2:
unchanged:
--- a/core/config/schema/core.menu.schema.yml
+++ b/core/config/schema/core.menu.schema.yml
@@ -1,6 +1,7 @@
-core.menu.static_menu_link_overrides:
+
+menu_link.static.overrides:
type: mapping
- label: 'Static menu link overrides'
+ label: 'Menu link overrides'
mapping:
definitions:
type: sequence
only in patch2:
unchanged:
--- a/core/core.libraries.yml
+++ b/core/core.libraries.yml
@@ -371,13 +371,13 @@ jquery.intrinsic:
jquery.joyride:
remote: https://github.com/zurb/joyride
- version: v2.1.0
+ version: v2.0.3
license:
name: MIT
- url: https://github.com/zurb/joyride/blob/v2.1.0/README.markdown
+ url: https://github.com/zurb/joyride/blob/v2.0.3/README.markdown
gpl-compatible: true
js:
- assets/vendor/jquery-joyride/jquery.joyride-2.1.min.js: { minified: true }
+ assets/vendor/jquery-joyride/jquery.joyride-2.0.3.js: {}
dependencies:
- core/jquery
- core/jquery.cookie
only in patch2:
unchanged:
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -505,7 +505,7 @@ services:
- [fromRequestStack, ['@request_stack']]
router.admin_context:
class: Drupal\Core\Routing\AdminContext
- arguments: ['@current_route_match']
+ arguments: ['@request_stack']
router.route_provider:
class: Drupal\Core\Routing\RouteProvider
arguments: ['@database', '@router.builder', '@state']
only in patch2:
unchanged:
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -93,9 +93,9 @@ class Drupal {
const CORE_MINIMUM_SCHEMA_VERSION = 8000;
/**
- * The currently active container object, or NULL if not initialized yet.
+ * The currently active container object.
*
- * @var \Symfony\Component\DependencyInjection\ContainerInterface|null
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
*/
protected static $container;
@@ -117,7 +117,7 @@ public static function setContainer(ContainerInterface $container = NULL) {
* @deprecated This method is only useful for the testing environment. It
* should not be used otherwise.
*
- * @return \Symfony\Component\DependencyInjection\ContainerInterface|null
+ * @return \Symfony\Component\DependencyInjection\ContainerInterface
*/
public static function getContainer() {
return static::$container;
@@ -478,17 +478,6 @@ public static function urlGenerator() {
* the base path (like robots.txt) use Url::fromUri()->toString() with the
* base:// scheme.
*
- * @param string $route_name
- * The name of the route.
- * @param array $route_parameters
- * (optional) An associative array of parameter names and values.
- * @param array $options
- * (optional) An associative array of additional options.
- *
- * @return string
- * The generated URL for the given route.
- *
- * @see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute()
* @see \Drupal\Core\Url
* @see \Drupal\Core\Url::fromRoute()
* @see \Drupal\Core\Url::fromUri()
@@ -513,14 +502,6 @@ public static function linkGenerator() {
* generate() method. For detailed documentation, see
* \Drupal\Core\Routing\LinkGeneratorInterface::generate().
*
- * @param string $text
- * The link text for the anchor tag.
- * @param \Drupal\Core\Url $url
- * The URL object used for the link.
- *
- * @return string
- * An HTML string containing a link to the given route and parameters.
- *
* @see \Drupal\Core\Utility\LinkGeneratorInterface::generate()
* @see \Drupal\Core\Url
*/
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Asset/LibraryDiscovery.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscovery.php
@@ -79,11 +79,4 @@ public function getLibraryByName($extension, $name) {
return isset($extension[$name]) ? $extension[$name] : FALSE;
}
- /**
- * {@inheritdoc}
- */
- public function clearCachedDefinitions() {
- $this->collector->clear();
- }
-
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php
@@ -50,9 +50,4 @@ public function getLibrariesByExtension($extension);
*/
public function getLibraryByName($extension, $name);
- /**
- * Clears static and persistent library definition caches.
- */
- public function clearCachedDefinitions();
-
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
@@ -13,7 +13,6 @@
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
use Drupal\Component\Serialization\Yaml;
-use Drupal\Component\Utility\NestedArray;
/**
* Parses library files to get extension data.
@@ -78,11 +77,15 @@ public function buildByExtension($extension) {
$path = $this->drupalGetPath($extension_type, $extension);
}
- $libraries = $this->parseLibraryInfo($extension, $path);
+ $library_file = $path . '/' . $extension . '.libraries.yml';
+
+ if ($library_file && file_exists($this->root . '/' . $library_file)) {
+ $libraries = $this->parseLibraryInfo($extension, $library_file);
+ }
foreach ($libraries as $id => &$library) {
if (!isset($library['js']) && !isset($library['css']) && !isset($library['drupalSettings'])) {
- throw new IncompleteLibraryDefinitionException(sprintf("Incomplete library definition for definition '%s' in extension '%s'", $id, $extension));
+ throw new IncompleteLibraryDefinitionException(sprintf("Incomplete library definition for '%s' in %s", $id, $library_file));
}
$library += array('dependencies' => array(), 'js' => array(), 'css' => array());
@@ -99,7 +102,7 @@ public function buildByExtension($extension) {
// If this is a 3rd party library, the license info is required.
if (isset($library['remote']) && !isset($library['license'])) {
- throw new LibraryDefinitionMissingLicenseException(sprintf("Missing license information in library definition for definition '%s' extension '%s': it has a remote, but no license.", $id, $extension));
+ throw new LibraryDefinitionMissingLicenseException(sprintf("Missing license information in library definition for '%s' in %s: it has a remote, but no license.", $id, $library_file));
}
// Assign Drupal's license to libraries that don't have license info.
@@ -206,8 +209,8 @@ public function buildByExtension($extension) {
*
* @param string $extension
* The name of the extension that registered a library.
- * @param string $path
- * The relative path to the extension.
+ * @param string $library_file
+ * The relative filename to the DRUPAL_ROOT of the wanted library file.
*
* @return array
* An array of parsed library data.
@@ -215,26 +218,14 @@ public function buildByExtension($extension) {
* @throws \Drupal\Core\Asset\Exception\InvalidLibraryFileException
* Thrown when a parser exception got thrown.
*/
- protected function parseLibraryInfo($extension, $path) {
- $libraries = [];
-
- $library_file = $path . '/' . $extension . '.libraries.yml';
- if (file_exists($this->root . '/' . $library_file)) {
- try {
- $libraries = Yaml::decode(file_get_contents($this->root . '/' . $library_file));
- }
- catch (InvalidDataTypeException $e) {
- // Rethrow a more helpful exception to provide context.
- throw new InvalidLibraryFileException(sprintf('Invalid library definition in %s: %s', $library_file, $e->getMessage()), 0, $e);
- }
+ protected function parseLibraryInfo($extension, $library_file) {
+ try {
+ $libraries = Yaml::decode(file_get_contents($this->root . '/' . $library_file));
}
-
- // Allow modules to add dynamic library definitions.
- $hook = 'library_info_build';
- if ($this->moduleHandler->implementsHook($extension, $hook)) {
- $libraries = NestedArray::mergeDeep($libraries, $this->moduleHandler->invoke($extension, $hook));
+ catch (InvalidDataTypeException $e) {
+ // Rethrow a more helpful exception to provide context.
+ throw new InvalidLibraryFileException(sprintf('Invalid library definition in %s: %s', $library_file, $e->getMessage()), 0, $e);
}
-
// Allow modules to alter the module's registered libraries.
$this->moduleHandler->alter('library_info', $libraries, $extension);
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Block/BlockPluginInterface.php
+++ b/core/lib/Drupal/Core/Block/BlockPluginInterface.php
@@ -47,8 +47,8 @@ public function label();
* @param \Drupal\Core\Session\AccountInterface $account
* The user session for which to check access.
*
- * @return \Drupal\Core\Access\AccessResultInterface
- * An access result object instantiated and configured by the block plugin.
+ * @return bool
+ * TRUE if the block should be shown, or FALSE otherwise.
*
* @see \Drupal\block\BlockAccessControlHandler
*/
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Config/TypedConfigManager.php
+++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php
@@ -130,9 +130,7 @@ public function getDefinition($base_plugin_id, $exception_on_invalid = TRUE) {
// Check whether this type is an extension of another one and compile it.
if (isset($definition['type'])) {
$merge = $this->getDefinition($definition['type'], $exception_on_invalid);
- // Preserve integer keys on merge, so sequence item types can override
- // parent settings as opposed to adding unused second, third, etc. items.
- $definition = NestedArray::mergeDeepArray(array($merge, $definition), TRUE);
+ $definition = NestedArray::mergeDeep($merge, $definition);
// Unset type so we try the merge only once per type.
unset($definition['type']);
$this->definitions[$type] = $definition;
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Controller/ControllerResolver.php
+++ b/core/lib/Drupal/Core/Controller/ControllerResolver.php
@@ -138,15 +138,11 @@ protected function createController($controller) {
*/
protected function doGetArguments(Request $request, $controller, array $parameters) {
$attributes = $request->attributes->all();
- $raw_parameters = $request->attributes->has('_raw_variables') ? $request->attributes->get('_raw_variables') : [];
$arguments = array();
foreach ($parameters as $param) {
if (array_key_exists($param->name, $attributes)) {
$arguments[] = $attributes[$param->name];
}
- elseif (array_key_exists($param->name, $raw_parameters)) {
- $arguments[] = $attributes[$param->name];
- }
elseif ($param->getClass() && $param->getClass()->isInstance($request)) {
$arguments[] = $request;
}
@@ -170,6 +166,21 @@ protected function doGetArguments(Request $request, $controller, array $paramete
throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument (because there is no default value or because there is a non optional argument after this one).', $repr, $param->name));
}
}
+
+ // The parameter converter overrides the raw request attributes with the
+ // upcasted objects. However, it keeps a backup copy of the original, raw
+ // values in a special request attribute ('_raw_variables'). If a controller
+ // argument has a type hint, we pass it the upcasted object, otherwise we
+ // pass it the original, raw value.
+ if ($request->attributes->has('_raw_variables') && $raw = $request->attributes->get('_raw_variables')->all()) {
+ foreach ($parameters as $parameter) {
+ // Use the raw value if a parameter has no typehint.
+ if (!$parameter->getClass() && isset($raw[$parameter->name])) {
+ $position = $parameter->getPosition();
+ $arguments[$position] = $raw[$parameter->name];
+ }
+ }
+ }
return $arguments;
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Field/FieldItemList.php
+++ b/core/lib/Drupal/Core/Field/FieldItemList.php
@@ -27,9 +27,10 @@
class FieldItemList extends ItemList implements FieldItemListInterface {
/**
- * Numerically indexed array of field items.
+ * Numerically indexed array of field items, implementing the
+ * FieldItemInterface.
*
- * @var \Drupal\Core\Field\FieldItemInterface[]
+ * @var array
*/
protected $list = array();
@@ -110,11 +111,13 @@ public function filterEmptyItems() {
* @todo Revisit the need when all entity types are converted to NG entities.
*/
public function getValue($include_computed = FALSE) {
- $values = array();
- foreach ($this->list as $delta => $item) {
- $values[$delta] = $item->getValue($include_computed);
+ if (isset($this->list)) {
+ $values = array();
+ foreach ($this->list as $delta => $item) {
+ $values[$delta] = $item->getValue($include_computed);
+ }
+ return $values;
}
- return $values;
}
/**
@@ -236,8 +239,10 @@ public function deleteRevision() {
* The name of the method.
*/
protected function delegateMethod($method) {
- foreach ($this->list as $item) {
- $item->{$method}();
+ if (isset($this->list)) {
+ foreach ($this->list as $item) {
+ $item->{$method}();
+ }
}
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Form/FormBase.php
+++ b/core/lib/Drupal/Core/Form/FormBase.php
@@ -54,13 +54,6 @@
protected $loggerFactory;
/**
- * The route match.
- *
- * @var \Drupal\Core\Routing\RouteMatchInterface
- */
- protected $routeMatch;
-
- /**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
@@ -143,18 +136,6 @@ protected function getRequest() {
}
/**
- * Gets the route match.
- *
- * @return \Drupal\Core\Routing\RouteMatchInterface
- */
- protected function getRouteMatch() {
- if (!$this->routeMatch) {
- $this->routeMatch = \Drupal::routeMatch();
- }
- return $this->routeMatch;
- }
-
- /**
* Sets the request stack object to use.
*
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
+++ b/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
@@ -808,7 +808,7 @@ public function loadTreeData($menu_name, MenuTreeParameters $parameters) {
// Build the cache ID; sort 'expanded' and 'conditions' to prevent duplicate
// cache items.
sort($parameters->expandedParents);
- asort($parameters->conditions);
+ sort($parameters->conditions);
$tree_cid = "tree-data:$menu_name:" . serialize($parameters);
$cache = $this->menuCacheBackend->get($tree_cid);
if ($cache && isset($cache->data)) {
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php
+++ b/core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php
@@ -19,7 +19,7 @@ class StaticMenuLinkOverrides implements StaticMenuLinkOverridesInterface {
*
* @var string
*/
- protected $configName = 'core.menu.static_menu_link_overrides';
+ protected $configName = 'menu_link.static.overrides';
/**
* The menu link overrides config object.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Render/Element/MoreLink.php
+++ b/core/lib/Drupal/Core/Render/Element/MoreLink.php
@@ -18,6 +18,7 @@ class MoreLink extends Link {
* {@inheritdoc}
*/
public function getInfo() {
+ $class = get_class($this);
$info = parent::getInfo();
return array(
'#title' => $this->t('More'),
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Routing/AdminContext.php
+++ b/core/lib/Drupal/Core/Routing/AdminContext.php
@@ -7,6 +7,8 @@
namespace Drupal\Core\Routing;
+use Symfony\Cmf\Component\Routing\RouteObjectInterface;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Routing\Route;
/**
@@ -15,20 +17,20 @@
class AdminContext {
/**
- * The route match.
+ * The request stack
*
- * @var \Drupal\Core\Routing\RouteMatchInterface
+ * @var \Symfony\Component\HttpFoundation\RequestStack
*/
- protected $routeMatch;
+ protected $requestStack;
/**
* Construct a new admin context helper instance.
*
- * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
- * The route match.
+ * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
+ * The request stack used to determine the current request.
*/
- public function __construct(RouteMatchInterface $route_match) {
- $this->routeMatch = $route_match;
+ public function __construct(RequestStack $request_stack) {
+ $this->requestStack = $request_stack;
}
/**
@@ -43,7 +45,7 @@ public function __construct(RouteMatchInterface $route_match) {
*/
public function isAdminRoute(Route $route = NULL) {
if (!$route) {
- $route = $this->routeMatch->getRouteObject();
+ $route = $this->getRouteFromRequest();
if (!$route) {
return FALSE;
}
@@ -51,4 +53,17 @@ public function isAdminRoute(Route $route = NULL) {
return (bool) $route->getOption('_admin_route');
}
+ /**
+ * Extract the route object from the request if one is available.
+ *
+ * @return \Symfony\Component\Routing\Route
+ * The route object extracted from the current request.
+ */
+ protected function getRouteFromRequest() {
+ $request = $this->requestStack->getCurrentRequest();
+ if ($request) {
+ return $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT);
+ }
+ }
+
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php
+++ b/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php
@@ -132,11 +132,4 @@ public function getParentRouteMatch() {
return $this->getRouteMatch($this->requestStack->getParentRequest());
}
- /**
- * {@inheritdoc}
- */
- public function getRouteMatchFromRequest(Request $request) {
- return $this->getRouteMatch($request);
- }
-
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Routing/StackedRouteMatchInterface.php
+++ b/core/lib/Drupal/Core/Routing/StackedRouteMatchInterface.php
@@ -7,8 +7,6 @@
namespace Drupal\Core\Routing;
-use Symfony\Component\HttpFoundation\Request;
-
/**
* Defines an interface for a stack of route matches.
*
@@ -38,15 +36,5 @@ public function getMasterRouteMatch();
*/
public function getParentRouteMatch();
- /**
- * Returns a route match from a given request, if possible.
- *
- * @param \Symfony\Component\HttpFoundation\Request
- * The request.
- *
- * @return \Drupal\Core\Routing\RouteMatchInterface|NULL
- * THe matching route match, or NULL if there is no matching one.
- */
- public function getRouteMatchFromRequest(Request $request);
-
}
+
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php
@@ -31,9 +31,9 @@
class ItemList extends TypedData implements \IteratorAggregate, ListInterface {
/**
- * Numerically indexed array of items.
+ * Numerically indexed array items.
*
- * @var \Drupal\Core\TypedData\TypedDataInterface[]
+ * @var array
*/
protected $list = array();
@@ -41,11 +41,13 @@ class ItemList extends TypedData implements \IteratorAggregate, ListInterface {
* Overrides \Drupal\Core\TypedData\TypedData::getValue().
*/
public function getValue() {
- $values = array();
- foreach ($this->list as $delta => $item) {
- $values[$delta] = $item->getValue();
+ if (isset($this->list)) {
+ $values = array();
+ foreach ($this->list as $delta => $item) {
+ $values[$delta] = $item->getValue();
+ }
+ return $values;
}
- return $values;
}
/**
@@ -64,7 +66,9 @@ public function setValue($values, $notify = TRUE) {
}
// Clear the values of properties for which no value has been passed.
- $this->list = array_intersect_key($this->list, $values);
+ if (isset($this->list)) {
+ $this->list = array_intersect_key($this->list, $values);
+ }
// Set the values.
foreach ($values as $delta => $value) {
@@ -90,11 +94,13 @@ public function setValue($values, $notify = TRUE) {
*/
public function getString() {
$strings = array();
- foreach ($this->list as $item) {
- $strings[] = $item->getString();
+ if (isset($this->list)) {
+ foreach ($this->list as $item) {
+ $strings[] = $item->getString();
+ }
+ // Remove any empty strings resulting from empty items.
+ return implode(', ', array_filter($strings, '\Drupal\Component\Utility\Unicode::strlen'));
}
- // Remove any empty strings resulting from empty items.
- return implode(', ', array_filter($strings, '\Drupal\Component\Utility\Unicode::strlen'));
}
/**
@@ -140,14 +146,16 @@ public function first() {
* Implements \ArrayAccess::offsetExists().
*/
public function offsetExists($offset) {
- return array_key_exists($offset, $this->list) && $this->get($offset)->getValue() !== NULL;
+ return isset($this->list) && array_key_exists($offset, $this->list) && $this->get($offset)->getValue() !== NULL;
}
/**
* Implements \ArrayAccess::offsetUnset().
*/
public function offsetUnset($offset) {
- unset($this->list[$offset]);
+ if (isset($this->list)) {
+ unset($this->list[$offset]);
+ }
}
/**
@@ -188,30 +196,35 @@ public function offsetSet($offset, $value) {
* Implements \IteratorAggregate::getIterator().
*/
public function getIterator() {
- return new \ArrayIterator($this->list);
+ if (isset($this->list)) {
+ return new \ArrayIterator($this->list);
+ }
+ return new \ArrayIterator(array());
}
/**
* Implements \Countable::count().
*/
public function count() {
- return count($this->list);
+ return isset($this->list) ? count($this->list) : 0;
}
/**
* Implements \Drupal\Core\TypedData\ListInterface::isEmpty().
*/
public function isEmpty() {
- foreach ($this->list as $item) {
- if ($item instanceof ComplexDataInterface || $item instanceof ListInterface) {
- if (!$item->isEmpty()) {
+ if (isset($this->list)) {
+ foreach ($this->list as $item) {
+ if ($item instanceof ComplexDataInterface || $item instanceof ListInterface) {
+ if (!$item->isEmpty()) {
+ return FALSE;
+ }
+ }
+ // Other items are treated as empty if they have no value only.
+ elseif ($item->getValue() !== NULL) {
return FALSE;
}
}
- // Other items are treated as empty if they have no value only.
- elseif ($item->getValue() !== NULL) {
- return FALSE;
- }
}
return TRUE;
}
@@ -220,22 +233,24 @@ public function isEmpty() {
* {@inheritdoc}
*/
public function filter($callback) {
- $removed = FALSE;
- // Apply the filter, detecting if some items were actually removed.
- $this->list = array_filter($this->list, function ($item) use ($callback, &$removed) {
- if (call_user_func($callback, $item)) {
- return TRUE;
- }
- else {
- $removed = TRUE;
- }
- });
- if ($removed) {
- // Rekey the array using array_values().
- $this->list = array_values($this->list);
- // Manually update each item's delta.
- foreach ($this->list as $delta => $item) {
- $item->setContext($delta, $this);
+ if (isset($this->list)) {
+ $removed = FALSE;
+ // Apply the filter, detecting if some items were actually removed.
+ $this->list = array_filter($this->list, function ($item) use ($callback, &$removed) {
+ if (call_user_func($callback, $item)) {
+ return TRUE;
+ }
+ else {
+ $removed = TRUE;
+ }
+ });
+ if ($removed) {
+ // Rekey the array using array_values().
+ $this->list = array_values($this->list);
+ // Manually update each item's delta.
+ foreach ($this->list as $delta => $item) {
+ $item->setContext($delta, $this);
+ }
}
}
return $this;
@@ -255,10 +270,11 @@ public function onChange($delta) {
* Magic method: Implements a deep clone.
*/
public function __clone() {
- foreach ($this->list as $delta => $item) {
- $this->list[$delta] = clone $item;
- $this->list[$delta]->setContext($delta, $this);
+ if (isset($this->list)) {
+ foreach ($this->list as $delta => $item) {
+ $this->list[$delta] = clone $item;
+ $this->list[$delta]->setContext($delta, $this);
+ }
}
}
-
}
only in patch2:
unchanged:
--- a/core/modules/breakpoint/breakpoint.module
+++ b/core/modules/breakpoint/breakpoint.module
@@ -15,7 +15,7 @@ function breakpoint_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.breakpoint':
$output = '';
$output .= '' . t('About') . '
';
- $output .= '' . t('The Breakpoint module keeps track of the height, width, and resolution breakpoints where a responsive design needs to change in order to respond to different devices being used to view the site. This module does not have a user interface. For more information, see the online documentation for the Breakpoint module.', array('!docs' => 'https://drupal.org/documentation/modules/breakpoint')) . '
';
+ $output .= '' . t('The Breakpoint module keeps track of the height, width, and resolution breakpoints where a responsive design needs to change in order to respond to different devices being used to view the site. This module does not have a user interface, but contributed modules such as Breakpoint UI may provide one. For more information, see the online documentation for the Breakpoint module.', array('!docs' => 'https://drupal.org/documentation/modules/breakpoint', '!breakpoint_ui' => 'https://drupal.org/project/breakpoint_ui')) . '
';
$output .= '' . t('Terminology') . '
';
$output .= '';
$output .= '- ' . t('Breakpoint') . '
';
only in patch2:
unchanged:
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -314,9 +314,9 @@ function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL)
* Implements hook_form_FORM_ID_alter() for field_ui_field_storage_add_form.
*/
function comment_form_field_ui_field_storage_add_form_alter(&$form, FormStateInterface $form_state) {
- $route_match = \Drupal::routeMatch();
- if ($form_state->get('entity_type_id') == 'comment' && $route_match->getParameter('commented_entity_type')) {
- $form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($route_match->getParameter('commented_entity_type'), $route_match->getParameter('field_name'));
+ $request = \Drupal::request();
+ if ($form_state->get('entity_type_id') == 'comment' && $request->attributes->has('commented_entity_type')) {
+ $form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($request->attributes->get('commented_entity_type'), $request->attributes->get('field_name'));
}
if (!_comment_entity_uses_integer_id($form_state->get('entity_type_id'))) {
// You cannot use comment fields on entity types with non-integer IDs.
@@ -328,9 +328,9 @@ function comment_form_field_ui_field_storage_add_form_alter(&$form, FormStateInt
* Implements hook_form_FORM_ID_alter().
*/
function comment_form_field_ui_form_display_overview_form_alter(&$form, FormStateInterface $form_state) {
- $route_match = \Drupal::routeMatch();
- if ($form['#entity_type'] == 'comment' && $route_match->getParameter('commented_entity_type')) {
- $form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($route_match->getParameter('commented_entity_type'), $route_match->getParameter('field_name'));
+ $request = \Drupal::request();
+ if ($form['#entity_type'] == 'comment' && $request->attributes->has('commented_entity_type')) {
+ $form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($request->attributes->get('commented_entity_type'), $request->attributes->get('field_name'));
}
}
@@ -338,9 +338,9 @@ function comment_form_field_ui_form_display_overview_form_alter(&$form, FormStat
* Implements hook_form_FORM_ID_alter().
*/
function comment_form_field_ui_display_overview_form_alter(&$form, FormStateInterface $form_state) {
- $route_match = \Drupal::routeMatch();
- if ($form['#entity_type'] == 'comment' && $route_match->getParameter('commented_entity_type')) {
- $form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($route_match->getParameter('commented_entity_type'), $route_match->getParameter('field_name'));
+ $request = \Drupal::request();
+ if ($form['#entity_type'] == 'comment' && $request->attributes->has('commented_entity_type')) {
+ $form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($request->attributes->get('commented_entity_type'), $request->attributes->get('field_name'));
}
}
only in patch2:
unchanged:
--- a/core/modules/comment/src/CommentAccessControlHandler.php
+++ b/core/modules/comment/src/CommentAccessControlHandler.php
@@ -57,6 +57,8 @@ protected function checkCreateAccess(AccountInterface $account, array $context,
* {@inheritdoc}
*/
protected function checkFieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
+ /** @var \Drupal\comment\CommentInterface $entity */
+ $entity = $items->getEntity();
if ($operation == 'edit') {
// Only users with the "administer comments" permission can edit
// administrative fields.
@@ -85,22 +87,13 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_
if (in_array($field_definition->getName(), $read_only_fields, TRUE)) {
return AccessResult::forbidden();
}
+ $commented_entity = $entity->getCommentedEntity();
+ $anonymous_contact = $commented_entity->get($entity->getFieldName())->getFieldDefinition()->getSetting('anonymous_contact');
// If the field is configured to accept anonymous contact details - admins
// can edit name, homepage and mail. Anonymous users can also fill in the
// fields on comment creation.
if (in_array($field_definition->getName(), ['name', 'mail', 'homepage'], TRUE)) {
- if (!$items) {
- // We cannot make a decision about access to edit these fields if we
- // don't have any items and therefore cannot determine the Comment
- // entity. In this case we err on the side of caution and prevent edit
- // access.
- return AccessResult::forbidden();
- }
- /** @var \Drupal\comment\CommentInterface $entity */
- $entity = $items->getEntity();
- $commented_entity = $entity->getCommentedEntity();
- $anonymous_contact = $commented_entity->get($entity->getFieldName())->getFieldDefinition()->getSetting('anonymous_contact');
$admin_access = AccessResult::allowedIfHasPermission($account, 'administer comments');
$anonymous_access = AccessResult::allowedIf($entity->isNew() && $account->isAnonymous() && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT && $account->hasPermission('post comments'))
->cachePerRole()
@@ -112,17 +105,14 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_
}
if ($operation == 'view') {
- $entity = $items ? $items->getEntity() : NULL;
// Admins can view any fields except hostname, other users need both the
// "access comments" permission and for the comment to be published. The
// mail field is hidden from non-admins.
$admin_access = AccessResult::allowedIf($account->hasPermission('administer comments') && $field_definition->getName() != 'hostname')
->cachePerRole();
- $anonymous_access = AccessResult::allowedIf($account->hasPermission('access comments') && (!$entity || $entity->isPublished()) && !in_array($field_definition->getName(), array('mail', 'hostname'), TRUE))
+ $anonymous_access = AccessResult::allowedIf($account->hasPermission('access comments') && $entity->isPublished() && !in_array($field_definition->getName(), array('mail', 'hostname'), TRUE))
+ ->cacheUntilEntityChanges($entity)
->cachePerRole();
- if ($entity) {
- $anonymous_access->cacheUntilEntityChanges($entity);
- }
return $admin_access->orIf($anonymous_access);
}
return parent::checkFieldAccess($operation, $field_definition, $account, $items);
only in patch2:
unchanged:
--- a/core/modules/comment/src/Tests/CommentTranslationUITest.php
+++ b/core/modules/comment/src/Tests/CommentTranslationUITest.php
@@ -9,6 +9,7 @@
use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\content_translation\Tests\ContentTranslationUITest;
+use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the Comment Translation UI.
@@ -70,6 +71,16 @@ protected function getTranslatorPermissions() {
}
/**
+ * Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::setupTestFields().
+ */
+ function setupTestFields() {
+ parent::setupTestFields();
+ $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
+ $field_storage->translatable = TRUE;
+ $field_storage->save();
+ }
+
+ /**
* Overrides \Drupal\content_translation\Tests\ContentTranslationUITest::createEntity().
*/
protected function createEntity($values, $langcode, $comment_type = 'comment_article') {
only in patch2:
unchanged:
--- a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php
+++ b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php
@@ -7,6 +7,7 @@
namespace Drupal\comment\Tests\Views;
+use Drupal\field\Entity\FieldStorageConfig;
use Drupal\language\Entity\ConfigurableLanguage;
/**
@@ -43,6 +44,12 @@ function setUp() {
ConfigurableLanguage::createFromLangcode('fr')->save();
ConfigurableLanguage::createFromLangcode('es')->save();
+ // Make the comment body field translatable. The title is already
+ // translatable by definition.
+ $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
+ $field_storage->translatable = TRUE;
+ $field_storage->save();
+
// Set up comment titles.
$this->commentTitles = array(
'en' => 'Food in Paris',
only in patch2:
unchanged:
--- a/core/modules/comment/src/Tests/Views/CommentRestExportTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
- 0,
- 'entity_id' => $this->nodeUserCommented->id(),
- 'entity_type' => 'node',
- 'field_name' => 'comment',
- 'subject' => 'A lot, apparently',
- 'cid' => '',
- 'pid' => $this->comment->id(),
- 'mail' => 'someone@example.com',
- 'name' => 'bobby tables',
- 'hostname' => 'public.example.com',
- );
- $this->comment = entity_create('comment', $comment);
- $this->comment->save();
- }
-
-
- /**
- * Test comment row.
- */
- public function testCommentRestExport() {
- $this->drupalGet(sprintf('node/%d/comments', $this->nodeUserCommented->id()), [], ['Accept' => 'application/hal+json']);
- $this->assertResponse(200);
- $contents = Json::decode($this->getRawContent());
- $this->assertEqual($contents[0]['subject'], 'How much wood would a woodchuck chuck');
- $this->assertEqual($contents[1]['subject'], 'A lot, apparently');
- $this->assertEqual(count($contents), 2);
-
- // Ensure field-level access is respected - user shouldn't be able to see
- // mail or hostname fields.
- $this->assertNoText('someone@example.com');
- $this->assertNoText('public.example.com');
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/comment/src/Tests/Views/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/Views/CommentTestBase.php
@@ -79,10 +79,9 @@ protected function setUp() {
'entity_id' => $this->nodeUserCommented->id(),
'entity_type' => 'node',
'field_name' => 'comment',
- 'subject' => 'How much wood would a woodchuck chuck',
'cid' => '',
'pid' => '',
- 'mail' => 'someone@example.com',
+ 'node_type' => '',
);
$this->comment = entity_create('comment', $comment);
$this->comment->save();
only in patch2:
unchanged:
--- a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rest.yml
+++ /dev/null
@@ -1,388 +0,0 @@
-langcode: en
-status: true
-dependencies:
- config:
- - field.storage.comment.comment_body
- module:
- - comment
- - node
- - rest
- - text
- - user
-id: test_comment_rest
-label: 'Comments by node'
-module: views
-description: ''
-tag: ''
-base_table: comment
-base_field: cid
-core: 8.x
-display:
- default:
- display_plugin: default
- id: default
- display_title: Master
- position: 0
- display_options:
- access:
- type: perm
- options:
- perm: 'access content'
- cache:
- type: none
- options: { }
- query:
- type: views_query
- options:
- disable_sql_rewrite: false
- distinct: false
- replica: false
- query_comment: false
- query_tags: { }
- exposed_form:
- type: basic
- options:
- submit_button: Apply
- reset_button: false
- reset_button_label: Reset
- exposed_sorts_label: 'Sort by'
- expose_sort_order: true
- sort_asc_label: Asc
- sort_desc_label: Desc
- pager:
- type: full
- options:
- items_per_page: 10
- offset: 0
- id: 0
- total_pages: null
- expose:
- items_per_page: false
- items_per_page_label: 'Items per page'
- items_per_page_options: '5, 10, 25, 50'
- items_per_page_options_all: false
- items_per_page_options_all_label: '- All -'
- offset: false
- offset_label: Offset
- tags:
- previous: '‹ previous'
- next: 'next ›'
- first: '« first'
- last: 'last »'
- quantity: 9
- style:
- type: serializer
- row:
- type: fields
- options:
- inline: { }
- separator: ''
- hide_empty: false
- default_field_elements: true
- relationships:
- node:
- id: node
- table: comment_field_data
- field: node
- required: true
- plugin_id: standard
- relationship: none
- group_type: group
- admin_label: Content
- fields:
- subject:
- id: subject
- table: comment_field_data
- field: subject
- relationship: none
- group_type: group
- entity_type: comment
- entity_field: subject
- admin_label: ''
- label: ''
- exclude: false
- alter:
- alter_text: false
- text: ''
- make_link: false
- path: ''
- absolute: false
- external: false
- replace_spaces: false
- path_case: none
- trim_whitespace: false
- alt: ''
- rel: ''
- link_class: ''
- prefix: ''
- suffix: ''
- target: ''
- nl2br: false
- max_length: ''
- word_boundary: true
- ellipsis: true
- more_link: false
- more_link_text: ''
- more_link_path: ''
- strip_tags: false
- trim: false
- preserve_tags: ''
- html: false
- element_type: ''
- element_class: ''
- element_label_type: ''
- element_label_class: ''
- element_label_colon: false
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- link_to_comment: true
- link_to_entity: false
- plugin_id: comment
- name:
- id: name
- table: comment_field_data
- field: name
- entity_type: comment
- entity_field: name
- relationship: none
- group_type: group
- admin_label: ''
- label: ''
- exclude: false
- alter:
- alter_text: false
- text: ''
- make_link: false
- path: ''
- absolute: false
- external: false
- replace_spaces: false
- path_case: none
- trim_whitespace: false
- alt: ''
- rel: ''
- link_class: ''
- prefix: ''
- suffix: ''
- target: ''
- nl2br: false
- max_length: ''
- word_boundary: true
- ellipsis: true
- more_link: false
- more_link_text: ''
- more_link_path: ''
- strip_tags: false
- trim: false
- preserve_tags: ''
- html: false
- element_type: ''
- element_class: ''
- element_label_type: ''
- element_label_class: ''
- element_label_colon: false
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- link_to_user: false
- plugin_id: comment_username
- created:
- id: created
- table: comment_field_data
- field: created
- entity_type: comment
- entity_field: created
- relationship: none
- group_type: group
- admin_label: ''
- label: ''
- exclude: false
- alter:
- alter_text: false
- text: ''
- make_link: false
- path: ''
- absolute: false
- external: false
- replace_spaces: false
- path_case: none
- trim_whitespace: false
- alt: ''
- rel: ''
- link_class: ''
- prefix: ''
- suffix: ''
- target: ''
- nl2br: false
- max_length: ''
- word_boundary: true
- ellipsis: true
- more_link: false
- more_link_text: ''
- more_link_path: ''
- strip_tags: false
- trim: false
- preserve_tags: ''
- html: false
- element_type: ''
- element_class: ''
- element_label_type: ''
- element_label_class: ''
- element_label_colon: false
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- date_format: long
- custom_date_format: ''
- timezone: ''
- plugin_id: date
- comment_body:
- id: comment_body
- table: comment__comment_body
- field: comment_body
- relationship: none
- entity_type: comment
- entity_field: comment_body
- group_type: group
- admin_label: ''
- label: ''
- exclude: false
- alter:
- alter_text: false
- text: ''
- make_link: false
- path: ''
- absolute: false
- external: false
- replace_spaces: false
- path_case: none
- trim_whitespace: false
- alt: ''
- rel: ''
- link_class: ''
- prefix: ''
- suffix: ''
- target: ''
- nl2br: false
- max_length: ''
- word_boundary: true
- ellipsis: true
- more_link: false
- more_link_text: ''
- more_link_path: ''
- strip_tags: false
- trim: false
- preserve_tags: ''
- html: false
- element_type: ''
- element_class: ''
- element_label_type: ''
- element_label_class: ''
- element_label_colon: false
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- click_sort_column: value
- type: text_default
- settings: { }
- group_column: value
- group_columns: { }
- group_rows: true
- delta_limit: all
- delta_offset: '0'
- delta_reversed: false
- delta_first_last: false
- multi_type: separator
- separator: ', '
- field_api_classes: false
- plugin_id: field
- filters: { }
- sorts: { }
- header: { }
- footer: { }
- empty: { }
- arguments:
- nid:
- id: nid
- table: node
- field: nid
- relationship: node
- group_type: group
- admin_label: ''
- default_action: default
- exception:
- value: all
- title_enable: false
- title: All
- title_enable: false
- title: ''
- default_argument_type: node
- default_argument_skip_url: false
- summary_options:
- base_path: ''
- count: true
- items_per_page: 25
- override: false
- summary:
- sort_order: asc
- number_of_records: 0
- format: default_summary
- specify_validation: false
- validate:
- type: none
- fail: 'not found'
- validate_options: { }
- break_phrase: false
- not: false
- plugin_id: numeric
- field_langcode: '***LANGUAGE_language_content***'
- field_langcode_add_to_query: null
- display_extenders: { }
- rest_export_1:
- display_plugin: rest_export
- id: rest_export_1
- display_title: 'REST export'
- position: 1
- display_options:
- field_langcode: '***LANGUAGE_language_content***'
- field_langcode_add_to_query: null
- path: node/%node/comments
- pager:
- type: some
- options:
- items_per_page: 10
- offset: 0
- style:
- type: serializer
- options:
- uses_fields: false
- formats:
- json: json
- row:
- type: data_field
- options:
- field_options:
- subject:
- alias: ''
- raw_output: true
- name:
- alias: ''
- raw_output: true
- display_extenders: { }
only in patch2:
unchanged:
--- a/core/modules/config_translation/src/ConfigEntityMapper.php
+++ b/core/modules/config_translation/src/ConfigEntityMapper.php
@@ -11,7 +11,6 @@
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\Routing\RouteMatch;
use Drupal\Core\Routing\RouteProviderInterface;
use Drupal\Core\StringTranslation\TranslationInterface;
use Drupal\Core\Url;
only in patch2:
unchanged:
--- a/core/modules/config_translation/src/ConfigMapperInterface.php
+++ b/core/modules/config_translation/src/ConfigMapperInterface.php
@@ -281,8 +281,6 @@ public function hasTranslation(LanguageInterface $language);
/**
* Populate the config mapper with request data.
*
- * @todo Replace $request with RouteMatch https://www.drupal.org/node/2295255.
- *
* @param \Symfony\Component\HttpFoundation\Request $request
* Page request object.
*/
only in patch2:
unchanged:
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -115,7 +115,7 @@ function contact_mail($key, &$message, $params) {
$message['subject'] .= t('[!form] !subject', $variables, $options);
$message['body'][] = t("!sender-name (!sender-url) sent a message using the contact form at !form-url.", $variables, $options);
$build = entity_view($contact_message, 'mail', $language->getId());
- $message['body'][] = \Drupal::service('renderer')->renderPlain($build);
+ $message['body'][] = drupal_render_root($build);
break;
case 'page_autoreply':
@@ -134,7 +134,7 @@ function contact_mail($key, &$message, $params) {
$message['body'][] = t("!sender-name (!sender-url) has sent you a message via your contact form at !site-name.", $variables, $options);
$message['body'][] = t("If you don't want to receive such emails, you can change your settings at !recipient-edit-url.", $variables, $options);
$build = entity_view($contact_message, 'mail', $language->getId());
- $message['body'][] = \Drupal::service('renderer')->renderPlain($build);
+ $message['body'][] = drupal_render_root($build);
break;
}
}
only in patch2:
unchanged:
--- a/core/modules/content_translation/src/Controller/ContentTranslationController.php
+++ b/core/modules/content_translation/src/Controller/ContentTranslationController.php
@@ -10,8 +10,8 @@
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Language\LanguageInterface;
-use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
+use Symfony\Component\HttpFoundation\Request;
/**
* Base class for entity translation controllers.
@@ -37,15 +37,16 @@ public function prepareTranslation(ContentEntityInterface $entity, LanguageInter
/**
* Builds the translations overview page.
*
- * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
- * The route match.
+ * @param \Symfony\Component\HttpFoundation\Request $request
+ * The request object from which to extract the entity type.
* @param string $entity_type_id
* (optional) The entity type ID.
- * @return array Array of page elements to render.
- * Array of page elements to render.
+ *
+ * @return array
+ * Array of page elements to render.
*/
- public function overview(RouteMatchInterface $route_match, $entity_type_id = NULL) {
- $entity = $route_match->getParameter($entity_type_id);
+ public function overview(Request $request, $entity_type_id = NULL) {
+ $entity = $request->attributes->get($entity_type_id);
$account = $this->currentUser();
$handler = $this->entityManager()->getHandler($entity_type_id, 'translation');
@@ -251,16 +252,16 @@ public function overview(RouteMatchInterface $route_match, $entity_type_id = NUL
* @param \Drupal\Core\Language\LanguageInterface $target
* The language of the translated values. Defaults to the current content
* language.
- * @param \Drupal\Core\Routing\RouteMatchInterface
- * The route match object from which to extract the entity type.
+ * @param \Symfony\Component\HttpFoundation\Request $request
+ * The request object from which to extract the entity type.
* @param string $entity_type_id
* (optional) The entity type ID.
*
* @return array
* A processed form array ready to be rendered.
*/
- public function add(LanguageInterface $source, LanguageInterface $target, RouteMatchInterface $route_match, $entity_type_id = NULL) {
- $entity = $route_match->getParameter($entity_type_id);
+ public function add(LanguageInterface $source, LanguageInterface $target, Request $request, $entity_type_id = NULL) {
+ $entity = $request->attributes->get($entity_type_id);
// @todo Exploit the upcoming hook_entity_prepare() when available.
// See https://www.drupal.org/node/1810394.
@@ -286,16 +287,16 @@ public function add(LanguageInterface $source, LanguageInterface $target, RouteM
* @param \Drupal\Core\Language\LanguageInterface $language
* The language of the translated values. Defaults to the current content
* language.
- * @param \Drupal\Core\Routing\RouteMatchInterface
- * The route match object from which to extract the entity type.
+ * @param \Symfony\Component\HttpFoundation\Request $request
+ * The request object from which to extract the entity type.
* @param string $entity_type_id
* (optional) The entity type ID.
*
* @return array
* A processed form array ready to be rendered.
*/
- public function edit(LanguageInterface $language, RouteMatchInterface $route_match, $entity_type_id = NULL) {
- $entity = $route_match->getParameter($entity_type_id);
+ public function edit(LanguageInterface $language, Request $request, $entity_type_id = NULL) {
+ $entity = $request->attributes->get($entity_type_id);
// @todo Provide a way to figure out the default form operation. Maybe like
// $operation = isset($info['default_operation']) ? $info['default_operation'] : 'default';
only in patch2:
unchanged:
--- a/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php
+++ b/core/modules/content_translation/src/Form/ContentTranslationDeleteForm.php
@@ -9,7 +9,6 @@
use Drupal\Core\Form\ConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Url;
/**
@@ -41,9 +40,9 @@ public function getFormId() {
/**
* {@inheritdoc}
*/
- public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, LanguageInterface $language = NULL) {
- $this->entity = $this->getRouteMatch()->getParameter($entity_type_id);
- $this->language = $language;
+ public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $language = NULL) {
+ $this->entity = $this->getRequest()->attributes->get($entity_type_id);
+ $this->language = language_load($language);
return parent::buildForm($form, $form_state);
}
only in patch2:
unchanged:
--- a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php
@@ -225,21 +225,26 @@ protected function assertSettings($entity_type, $bundle, $enabled, $edit) {
* Tests that field setting depends on bundle translatability.
*/
function testFieldTranslatableSettingsUI() {
+
// At least one field needs to be translatable to enable article for
- // translation. Create an extra field to be used for this purpose. We use
- // the UI to test our form alterations.
- $edit = array(
- 'new_storage_type' => 'text',
- 'label' => 'Test',
+ // translation. Create an extra field to be used for this purpose.
+ $field_storage = array(
+ 'field_name' => 'article_text',
+ 'entity_type' => 'node',
+ 'type' => 'text',
+ );
+ entity_create('field_storage_config', $field_storage)->save();
+ $field = array(
'field_name' => 'article_text',
+ 'entity_type' => 'node',
+ 'bundle' => 'article',
);
- $this->drupalPostForm('admin/structure/types/manage/article/fields/add-field', $edit, 'Save and continue');
+ entity_create('field_config', $field)->save();
// Tests that field doesn't have translatable setting if bundle is not
// translatable.
- $path = 'admin/structure/types/manage/article/fields/node.article.field_article_text';
+ $path = 'admin/structure/types/manage/article/fields/node.article.body';
$this->drupalGet($path);
- $this->assertFieldByXPath('//input[@id="edit-field-translatable" and @disabled="disabled"]');
$this->assertText('To configure translation for this field, enable language support for this type.', 'No translatable setting for field.');
// Tests that field has translatable setting if bundle is translatable.
@@ -248,12 +253,11 @@ function testFieldTranslatableSettingsUI() {
'entity_types[node]' => TRUE,
'settings[node][article][settings][language][language_alterable]' => TRUE,
'settings[node][article][translatable]' => TRUE,
- 'settings[node][article][fields][field_article_text]' => TRUE,
+ 'settings[node][article][fields][article_text]' => TRUE,
);
$this->assertSettings('node', 'article', TRUE, $edit);
$this->drupalGet($path);
- $this->assertFieldByXPath('//input[@id="edit-field-translatable" and not(@disabled) and @checked="checked"]');
- $this->assertNoText('To enable translation of this field, enable language support for this type.', 'Translatable setting for field available.');
+ $this->assertNoText('To enable translation of this field, enable language support for this type.', 'No translatable setting for field.');
}
/**
only in patch2:
unchanged:
--- a/core/modules/content_translation/src/Tests/ContentTranslationStandardFieldsTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationStandardFieldsTest.php
@@ -62,19 +62,14 @@ public function testFieldTranslatableArticle() {
$path = 'admin/config/regional/content-language';
$this->drupalGet($path);
- // Check content block fields.
- $this->assertFieldByXPath("//input[@id='edit-settings-block-content-basic-fields-body' and @checked='checked']");
-
- // Check comment fields.
- $this->assertFieldByXPath("//input[@id='edit-settings-comment-comment-fields-comment-body' and @checked='checked']");
-
- // Check node fields.
+ // Check comment checkbox.
$this->assertFieldByXPath("//input[@id='edit-settings-node-article-fields-comment' and @checked='checked']");
+
+ // Check image checkbox.
$this->assertFieldByXPath("//input[@id='edit-settings-node-article-fields-field-image' and @checked='checked']");
- $this->assertFieldByXPath("//input[@id='edit-settings-node-article-fields-field-tags' and @checked='checked']");
- // Check user fields.
- $this->assertFieldByXPath("//input[@id='edit-settings-user-user-fields-user-picture' and @checked='checked']");
+ // Check tag checkbox.
+ $this->assertFieldByXPath("//input[@id='edit-settings-node-article-fields-field-tags' and @checked='checked']");
}
}
only in patch2:
unchanged:
--- a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php
@@ -54,6 +54,7 @@ protected function setupTestFields() {
'entity_type' => $this->entityTypeId,
'type' => 'image',
'cardinality' => $this->cardinality,
+ 'translatable' => TRUE,
))->save();
entity_create('field_config', array(
only in patch2:
unchanged:
--- a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
@@ -12,7 +12,7 @@
use Drupal\simpletest\WebTestBase;
/**
- * Base class for content translation tests.
+ * Tests content translation workflows.
*/
abstract class ContentTranslationTestBase extends WebTestBase {
@@ -181,6 +181,7 @@ protected function setupTestFields() {
'type' => 'string',
'entity_type' => $this->entityTypeId,
'cardinality' => 1,
+ 'translatable' => TRUE,
))->save();
entity_create('field_config', array(
'entity_type' => $this->entityTypeId,
@@ -207,7 +208,7 @@ protected function setupTestFields() {
* (optional) The entity bundle, if the entity uses bundles. Defaults to
* NULL. If left NULL, $this->bundle will be used.
*
- * @return string
+ * @return
* The entity id.
*/
protected function createEntity($values, $langcode, $bundle_name = NULL) {
only in patch2:
unchanged:
--- a/core/modules/field/src/Tests/TranslationTest.php
+++ b/core/modules/field/src/Tests/TranslationTest.php
@@ -85,6 +85,7 @@ protected function setUp() {
'entity_type' => $this->entity_type,
'type' => 'test_field',
'cardinality' => 4,
+ 'translatable' => TRUE,
);
$this->fieldStorage = entity_create('field_storage_config', $this->field_storage_definition);
$this->fieldStorage->save();
only in patch2:
unchanged:
--- a/core/modules/field/src/Tests/TranslationWebTest.php
+++ b/core/modules/field/src/Tests/TranslationWebTest.php
@@ -63,6 +63,7 @@ protected function setUp() {
'entity_type' => $this->entity_type,
'type' => 'test_field',
'cardinality' => 4,
+ 'translatable' => TRUE,
);
entity_create('field_storage_config', $field_storage)->save();
$this->fieldStorage = entity_load('field_storage_config', $this->entity_type . '.' . $this->field_name);
only in patch2:
unchanged:
--- a/core/modules/field/tests/modules/field_test/config/schema/field_test.schema.yml
+++ b/core/modules/field/tests/modules/field_test/config/schema/field_test.schema.yml
@@ -95,8 +95,7 @@ field.value.test_field:
type: label
label: 'Value'
-
-field.formatter.third_party.field_test:
+entity_view_display.third_party.field_test:
type: mapping
label: 'Field test entity display third party setting'
mapping:
only in patch2:
unchanged:
--- a/core/modules/field/tests/modules/field_third_party_test/config/schema/field_third_party_test.schema.yml
+++ b/core/modules/field/tests/modules/field_third_party_test/config/schema/field_third_party_test.schema.yml
@@ -1,14 +1,14 @@
-field.formatter.third_party.field_third_party_test:
+entity_view_display.third_party.field_third_party_test:
type: mapping
- label: 'field_third_party_test third party formatter settings'
+ label: 'field_third_party_test entity display settings'
mapping:
field_test_field_formatter_third_party_settings_form:
type: string
label: field_test_field_formatter_third_party_settings_form
-field.widget.third_party.field_third_party_test:
+entity_form_display.third_party.field_third_party_test:
type: mapping
- label: 'field_third_party_test third party widget settings'
+ label: 'field_third_party_test entity form display settings'
mapping:
field_test_widget_third_party_settings_form:
type: string
only in patch2:
unchanged:
--- a/core/modules/field_ui/src/Controller/FieldConfigListController.php
+++ b/core/modules/field_ui/src/Controller/FieldConfigListController.php
@@ -8,7 +8,6 @@
namespace Drupal\field_ui\Controller;
use Drupal\Core\Entity\Controller\EntityListController;
-use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\HttpFoundation\Request;
/**
@@ -23,18 +22,18 @@ class FieldConfigListController extends EntityListController {
* The entity type.
* @param string $bundle
* The entity bundle.
- * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
- * The current route match.
+ * @param \Symfony\Component\HttpFoundation\Request $request
+ * The current request.
*
* @return array
* A render array as expected by drupal_render().
*/
- public function listing($entity_type_id = NULL, $bundle = NULL, RouteMatchInterface $route_match = NULL) {
+ public function listing($entity_type_id = NULL, $bundle = NULL, Request $request = NULL) {
if (!$bundle) {
$entity_info = $this->entityManager()->getDefinition($entity_type_id);
- $bundle = $route_match->getRawParameter($entity_info->getBundleEntityType());
+ $bundle = $request->attributes->get('_raw_variables')->get($entity_info->getBundleEntityType());
}
- return $this->entityManager()->getListBuilder('field_config')->render($entity_type_id, $bundle);
+ return $this->entityManager()->getListBuilder('field_config')->render($entity_type_id, $bundle, $request);
}
}
only in patch2:
unchanged:
--- a/core/modules/field_ui/src/Form/FieldStorageAddForm.php
+++ b/core/modules/field_ui/src/Form/FieldStorageAddForm.php
@@ -122,7 +122,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t
$form_state->set('entity_type_id', $entity_type_id);
}
if (!$form_state->get('bundle')) {
- $bundle = $bundle ?: $this->getRouteMatch()->getRawParameter($this->bundleEntityTypeId);
+ $bundle = $bundle ?: $this->getRequest()->attributes->get('_raw_variables')->get($this->bundleEntityTypeId);
$form_state->set('bundle', $bundle);
}
@@ -223,13 +223,11 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t
);
}
- // Place the 'translatable' property as an explicit value so that contrib
- // modules can form_alter() the value for newly created fields. By default
- // we create field storage as translatable so it will be possible to enable
- // translation at field level.
+ // Place the 'translatable' property as an explicit value so that
+ // contrib modules can form_alter() the value for newly created fields.
$form['translatable'] = array(
'#type' => 'value',
- '#value' => TRUE,
+ '#value' => FALSE,
);
$form['actions'] = array('#type' => 'actions');
only in patch2:
unchanged:
--- a/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php
+++ b/core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php
@@ -103,8 +103,7 @@ protected function constructValue($data, $context) {
$field_item = $context['target_instance'];
$field_definition = $field_item->getFieldDefinition();
$target_type = $field_definition->getSetting('target_type');
- $id = $this->entityResolver->resolve($this, $data, $target_type);
- if (isset($id)) {
+ if ($id = $this->entityResolver->resolve($this, $data, $target_type)) {
return array('target_id' => $id);
}
return NULL;
only in patch2:
unchanged:
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -445,6 +445,19 @@ function language_get_browser_drupal_langcode_mappings() {
}
/**
+ * Stores language mappings between browser and Drupal language codes.
+ *
+ * @param array $mappings
+ * An array containing browser language codes as keys with corresponding
+ * Drupal language codes as values.
+ */
+function language_set_browser_drupal_langcode_mappings($mappings) {
+ $config = \Drupal::config('language.mappings');
+ $config->setData($mappings);
+ $config->save();
+}
+
+/**
* Implements hook_form_FORM_ID_alter for system_regional_settings().
*
* @see language_system_regional_settings_form_submit()
only in patch2:
unchanged:
--- a/core/modules/language/src/Form/NegotiationBrowserDeleteForm.php
+++ b/core/modules/language/src/Form/NegotiationBrowserDeleteForm.php
@@ -60,17 +60,20 @@ public function buildForm(array $form, FormStateInterface $form_state, $browser_
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->config('language.mappings')
- ->clear($this->browserLangcode)
- ->save();
+ $mappings = language_get_browser_drupal_langcode_mappings();
- $args = array(
- '%browser' => $this->browserLangcode,
- );
+ if (array_key_exists($this->browserLangcode, $mappings)) {
+ unset($mappings[$this->browserLangcode]);
+ language_set_browser_drupal_langcode_mappings($mappings);
- $this->logger('language')->notice('The browser language detection mapping for the %browser browser language code has been deleted.', $args);
+ $args = array(
+ '%browser' => $this->browserLangcode,
+ );
- drupal_set_message($this->t('The mapping for the %browser browser language code has been deleted.', $args));
+ $this->logger('language')->notice('The browser language detection mapping for the %browser browser language code has been deleted.', $args);
+
+ drupal_set_message($this->t('The mapping for the %browser browser language code has been deleted.', $args));
+ }
$form_state->setRedirect('language.negotiation_browser');
}
only in patch2:
unchanged:
--- a/core/modules/menu_ui/menu_ui.module
+++ b/core/modules/menu_ui/menu_ui.module
@@ -117,8 +117,10 @@ function menu_ui_menu_delete(Menu $menu) {
* Implements hook_block_view_BASE_BLOCK_ID_alter() for 'system_menu_block'.
*/
function menu_ui_block_view_system_menu_block_alter(array &$build, BlockPluginInterface $block) {
- if ($block->getBaseId() == 'system_menu_block') {
- $menu_name = $block->getDerivativeId();
+ // Add contextual links for system menu blocks.
+ $menus = menu_list_system_menus();
+ $menu_name = $block->getDerivativeId();
+ if (isset($menus[$menu_name])) {
$build['#contextual_links']['menu'] = array(
'route_parameters' => array('menu' => $menu_name),
);
only in patch2:
unchanged:
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -540,12 +540,11 @@ function testUnpublishedNodeMenuItem() {
*/
public function testBlockContextualLinks() {
$this->drupalLogin($this->drupalCreateUser(array('administer menu', 'access contextual links', 'administer blocks')));
- $custom_menu = $this->addCustomMenu();
- $this->addMenuLink('', '', $custom_menu->id());
- $block = $this->drupalPlaceBlock('system_menu_block:' . $custom_menu->id(), array('label' => 'Custom menu', 'provider' => 'system'));
+ $this->addMenuLink();
+ $block = $this->drupalPlaceBlock('system_menu_block:tools', array('label' => 'Tools', 'provider' => 'system'));
$this->drupalGet('test-page');
- $id = 'block:block=' . $block->id() . ':|menu:menu=' . $custom_menu->id() . ':';
+ $id = 'block:block=' . $block->id() . ':|menu:menu=tools:';
// @see \Drupal\contextual\Tests\ContextualDynamicContextTest:assertContextualLinkPlaceHolder()
$this->assertRaw('', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
@@ -555,12 +554,12 @@ public function testBlockContextualLinks() {
$response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page')));
$this->assertResponse(200);
$json = Json::decode($response);
- $this->assertIdentical($json[$id], '');
+ $this->assertIdentical($json[$id], '');
// Test the contextual links are available when block caching is enabled.
$this->drupalPostForm('admin/structure/block/manage/' . $block->id(), ['settings[cache][max_age]' => Cache::PERMANENT], t('Save block'));
$this->drupalGet('test-page');
- $id = 'block:block=' . $block->id() . ':|menu:menu=' . $custom_menu->id() . ':';
+ $id = 'block:block=' . $block->id() . ':|menu:menu=tools:';
$this->assertRaw('', format_string('Contextual link placeholder with id @id exists.', array('@id' => $id)));
}
only in patch2:
unchanged:
--- a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
+++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
@@ -207,15 +207,6 @@ public function getIterator() {
return $this->iterator;
}
- /**
- * Check if we can join against the map table.
- *
- * This function specifically catches issues when we're migrating with
- * unique sets of credentials for the source and destination database.
- *
- * @return bool
- * TRUE if we can join against the map table otherwise FALSE.
- */
protected function mapJoinable() {
if (!$this->getIds()) {
return FALSE;
@@ -235,5 +226,4 @@ protected function mapJoinable() {
}
return TRUE;
}
-
}
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php
+++ /dev/null
@@ -1,170 +0,0 @@
-getMockBuilder('Drupal\Core\Database\Connection')
- ->disableOriginalConstructor()
- ->getMock();
- $source_connection->expects($id_map_is_sql && $with_id_map ? $this->once() : $this->never())
- ->method('getConnectionOptions')
- ->willReturn($source_options);
-
- // Setup the id map connection.
- $idmap_connection = $this->getMockBuilder('Drupal\Core\Database\Connection')
- ->disableOriginalConstructor()
- ->getMock();
- $idmap_connection->expects($id_map_is_sql && $with_id_map ? $this->once() : $this->never())
- ->method('getConnectionOptions')
- ->willReturn($idmap_options);
-
- // Setup the Sql object.
- $sql = $this->getMockBuilder('Drupal\migrate\Plugin\migrate\id_map\Sql')
- ->disableOriginalConstructor()
- ->getMock();
- $sql->expects($id_map_is_sql && $with_id_map ? $this->once() : $this->never())
- ->method('getDatabase')
- ->willReturn($idmap_connection);
-
- // Setup a migration entity.
- $migration = $this->getMock('Drupal\migrate\Entity\MigrationInterface');
- $migration->expects($with_id_map ? $this->once() : $this->never())
- ->method('getIdMap')
- ->willReturn($id_map_is_sql ? $sql : NULL);
-
- // Create our SqlBase test class.
- $sql_base = new TestSqlBase();
- $sql_base->setMigration($migration);
- $sql_base->setDatabase($source_connection);
-
- // Configure the idMap to make the check in mapJoinable() pass.
- if ($with_id_map) {
- $sql_base->setIds([
- 'uid' => ['type' => 'integer', 'alias' => 'u'],
- ]);
- }
-
- $this->assertEquals($expected_result, $sql_base->mapJoinable());
- }
-
- /**
- * The data provider for SqlBase.
- *
- * @return array
- * An array of data per test run.
- */
- public function sqlBaseTestProvider() {
- return [
- // Source ids are empty so mapJoinable() is false.
- [FALSE, FALSE, FALSE],
- // Still false because getIdMap() is not a subclass of Sql.
- [FALSE, FALSE, TRUE],
- // Test mapJoinable() returns false when source and id connection options
- // differ.
- [FALSE, TRUE, TRUE, ['username' => 'different_from_map', 'password' => 'different_from_map'], ['username' => 'different_from_source', 'password' => 'different_from_source']],
- // Returns true because source and id map connection options are the same.
- [TRUE, TRUE, TRUE, ['username' => 'same_value', 'password' => 'same_value'], ['username' => 'same_value', 'password' => 'same_value']],
- ];
- }
-
-}
-
-class TestSqlBase extends SqlBase {
-
- protected $database;
- protected $ids;
-
- /**
- * Override the constructor so we can create one easily.
- */
- public function __construct() {}
-
- /**
- * Allows us to set the database during tests.
- *
- * @param mixed $database
- * The database mock object.
- */
- public function setDatabase($database) {
- $this->database = $database;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDatabase() {
- return $this->database;
- }
-
- /**
- * Allows us to set the migration during the test.
- *
- * @param mixed $migration
- * The migration mock.
- */
- public function setMigration($migration) {
- $this->migration = $migration;
- }
-
- /**
- * {@inheritdoc}
- */
- public function mapJoinable() {
- return parent::mapJoinable();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getIds() {
- return $this->ids;
- }
-
- /**
- * Allows us to set the ids during a test.
- */
- public function setIds($ids) {
- $this->ids = $ids;
- }
-
- /**
- * {@inheritdoc}
- */
- public function fields() {}
-
- /**
- * {@inheritdoc}
- */
- public function query() {}
-
-}
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/load/LoadEntity.php
@@ -101,16 +101,6 @@ public function loadMultiple(EntityStorageInterface $storage, array $sub_ids = N
],
];
}
- elseif ($data['type'] === 'filefield') {
- $migration->process[$field_name] = [
- 'plugin' => 'd6_cck_file',
- 'source' => [
- $field_name,
- $field_name . '_list',
- $field_name . '_data',
- ],
- ];
- }
else {
$migration->process[$field_name] = $field_name;
}
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/CckFile.php
+++ /dev/null
@@ -1,47 +0,0 @@
- $fid,
- 'display' => isset($list) ? $list : 0,
- 'description' => isset($options['description']) ? $options['description'] : '',
- ];
-
- return $file;
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6FieldInstance.php
+++ b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6FieldInstance.php
@@ -1070,10 +1070,10 @@ public function load() {
'field_name' => 'field_test_filefield',
'module' => 'filefield',
'type' => 'filefield',
- 'global_settings' => 'a:3:{s:10:"list_field";s:1:"0";s:12:"list_default";i:1;s:17:"description_field";s:21:"test file description";}',
+ 'global_settings' => 'a:3:{s:10:"list_field";s:1:"0";s:12:"list_default";i:1;s:17:"description_field";s:1:"1";}',
'multiple' => 0,
'db_storage' => 1,
- 'db_columns' => 'a:3:{s:3:"fid";a:3:{s:4:"type";s:3:"int";s:8:"not null";b:0;s:5:"views";b:1;}s:4:"list";a:4:{s:4:"type";s:3:"int";s:4:"size";s:4:"tiny";s:8:"not null";b:0;s:5:"views";b:1;}s:4:"data";a:3:{s:4:"type";s:4:"text";s:9:"serialize";b:1;s:5:"views";b:1;}}',
+ 'db_columns' => 'a:0:{}',
'active' => 1,
))
->values(array(
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6Node.php
+++ b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6Node.php
@@ -530,24 +530,6 @@ public function load() {
'type' => 'text',
'not null' => FALSE,
),
- 'field_test_filefield_fid' => array(
- 'description' => 'The file id.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'field_test_filefield_list' => array(
- 'description' => 'File list field.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'field_test_filefield_data' => array(
- 'description' => 'The file meta.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
),
'primary key' => array('vid'),
));
@@ -564,9 +546,6 @@ public function load() {
'field_test_link_url',
'field_test_link_title',
'field_test_link_attributes',
- 'field_test_filefield_fid',
- 'field_test_filefield_list',
- 'field_test_filefield_data'
))
->values(array(
'nid' => 1,
@@ -579,9 +558,6 @@ public function load() {
'field_test_link_url' => 'http://drupal.org/project/drupal',
'field_test_link_title' => 'Drupal project page',
'field_test_link_attributes' => 's:32:"a:1:{s:6:"target";s:6:"_blank";}";";',
- 'field_test_filefield_fid' => 1,
- 'field_test_filefield_list' => 1,
- 'field_test_filefield_data' => 'a:1:{s:11:"description";s:4:"desc";}'
))
->values(array(
'nid' => 1,
@@ -594,9 +570,6 @@ public function load() {
'field_test_link_url' => 'http://drupal.org/project/drupal',
'field_test_link_title' => 'Drupal project page',
'field_test_link_attributes' => 's:32:"a:1:{s:6:"target";s:6:"_blank";}";',
- 'field_test_filefield_fid' => 1,
- 'field_test_filefield_list' => 1,
- 'field_test_filefield_data' => 'a:1:{s:11:"description";s:4:"desc";}'
))
->values(array(
'nid' => 2,
@@ -609,9 +582,6 @@ public function load() {
'field_test_link_url' => 'http://groups.drupal.org/',
'field_test_link_title' => 'Drupal Groups',
'field_test_link_attributes' => 's:6:"a:0:{}";',
- 'field_test_filefield_fid' => 2,
- 'field_test_filefield_list' => 1,
- 'field_test_filefield_data' => 'a:1:{s:11:"description";s:4:"desc";}'
))
->values(array(
'nid' => 2,
@@ -624,9 +594,6 @@ public function load() {
'field_test_link_url' => 'http://groups.drupal.org/',
'field_test_link_title' => 'Drupal Groups',
'field_test_link_attributes' => 's:6:"a:0:{}";',
- 'field_test_filefield_fid' => 2,
- 'field_test_filefield_list' => 1,
- 'field_test_filefield_data' => 'a:1:{s:11:"description";s:4:"desc";}'
))
->execute();
$this->setModuleVersion('content', 6001);
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php
@@ -22,7 +22,7 @@ class MigrateCckFieldValuesTest extends MigrateNodeTestBase {
*
* @var array
*/
- public static $modules = array('node', 'text', 'link', 'file');
+ public static $modules = array('node', 'text', 'link');
/**
* {@inheritdoc}
@@ -126,17 +126,6 @@ protected function setUp() {
'bundle' => 'story',
))->save();
- entity_create('field_storage_config', array(
- 'entity_type' => 'node',
- 'field_name' => 'field_test_filefield',
- 'type' => 'file',
- ))->save();
- entity_create('field_config', array(
- 'entity_type' => 'node',
- 'field_name' => 'field_test_filefield',
- 'bundle' => 'story',
- ))->save();
-
// Add some id mappings for the dependant migrations.
$id_mappings = array(
'd6_field_formatter_settings' => array(
@@ -182,10 +171,6 @@ public function testCckFields() {
$this->assertIdentical($node->field_test_link->route_parameters, []);
$this->assertIdentical($node->field_test_link->options['attributes'], ['target' => '_blank']);
- // Test the file field meta.
- $this->assertIdentical($node->field_test_filefield->description, 'desc');
- $this->assertIdentical($node->field_test_filefield->target_id, '1');
-
$planet_node = Node::load(3);
$this->assertEqual($planet_node->field_multivalue->value, 33);
$this->assertEqual($planet_node->field_multivalue[1]->value, 44);
only in patch2:
unchanged:
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1187,7 +1187,7 @@ function node_access_rebuild($batch_mode = FALSE) {
* An array of contextual key/value information for rebuild batch process.
*/
function _node_access_rebuild_batch_operation(&$context) {
- $node_storage = \Drupal::entityManager()->getStorage('node');
+ $node_storage = $this->container->get('entity.manager')->getStorage('node');
if (empty($context['sandbox'])) {
// Initiate multistep processing.
$context['sandbox']['progress'] = 0;
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/argument_default/Node.php
+++ b/core/modules/node/src/Plugin/views/argument_default/Node.php
@@ -7,11 +7,9 @@
namespace Drupal\node\Plugin\views\argument_default;
-use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\Plugin\CacheablePluginInterface;
use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase;
use Drupal\node\NodeInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Default argument plugin to extract a node.
@@ -26,48 +24,10 @@
class Node extends ArgumentDefaultPluginBase implements CacheablePluginInterface {
/**
- * The route match.
- *
- * @var \Drupal\Core\Routing\RouteMatchInterface
- */
- protected $routeMatch;
-
- /**
- * Constructs a new Date instance.
- *
- * @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\RouteMatchInterface $route_match
- * The route match.
- */
- public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match) {
- parent::__construct($configuration, $plugin_id, $plugin_definition);
-
- $this->routeMatch = $route_match;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('current_route_match')
- );
- }
-
- /**
* {@inheritdoc}
*/
public function getArgument() {
- if (($node = $this->routeMatch->getParameter('node')) && $node instanceof NodeInterface) {
+ if (($node = $this->view->getRequest()->attributes->get('node')) && $node instanceof NodeInterface) {
return $node->id();
}
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php
+++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php
@@ -58,6 +58,7 @@ protected function setUp() {
'entity_type' => 'node',
'type' => 'boolean',
'cardinality' => 1,
+ 'translatable' => TRUE,
'settings' => array(
'on_label' => 'Private',
'off_label' => 'Not private',
only in patch2:
unchanged:
--- a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php
+++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php
@@ -56,10 +56,11 @@ protected function setUp() {
'entity_type' => 'node',
'type' => 'boolean',
'cardinality' => 1,
- 'settings' => array(
- 'on_label' => 'Private',
- 'off_label' => 'Not private',
- ),
+ 'translatable' => TRUE,
+ 'settings' => array(
+ 'on_label' => 'Private',
+ 'off_label' => 'Not private',
+ ),
));
$field_storage->save();
only in patch2:
unchanged:
--- a/core/modules/node/src/Tests/NodeAccessRebuildNodeGrantsTest.php
+++ /dev/null
@@ -1,85 +0,0 @@
-drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports', 'bypass node access'));
- $this->drupalLogin($admin_user);
-
- $this->webUser = $this->drupalCreateUser();
- }
-
- /**
- * Tests rebuilding the node access permissions table with content.
- */
- public function testNodeAccessRebuildNodeGrants() {
- \Drupal::service('module_installer')->install(['node_access_test']);
- $this->resetAll();
-
- $node = $this->drupalCreateNode(array(
- 'uid' => $this->webUser->id(),
- ));
-
- // Default realm access and node records are present.
- $this->assertTrue(\Drupal::service('node.grant_storage')->access($node, 'view', 'en', $this->webUser), 'The expected node access records are present');
- $this->assertEqual(1, \Drupal::service('node.grant_storage')->checkAll($this->webUser), 'There is an all realm access record');
- $this->assertTrue(\Drupal::state()->get('node.node_access_needs_rebuild'), 'Node access permissions need to be rebuilt');
-
- // Rebuild permissions.
- $this->drupalGet('admin/reports/status/rebuild');
- $this->drupalPostForm(NULL, array(), t('Rebuild permissions'));
- $this->assertText(t('The content access permissions have been rebuilt.'));
-
- // Test if the rebuild has been successful.
- $this->assertNull(\Drupal::state()->get('node.node_access_needs_rebuild'), 'Node access permissions have been rebuilt');
- $this->assertTrue(\Drupal::service('node.grant_storage')->access($node, 'view', 'en', $this->webUser), 'The expected node access records are present');
- $this->assertFalse(\Drupal::service('node.grant_storage')->checkAll($this->webUser), 'There is no all realm access record');
- }
-
- /**
- * Tests rebuilding the node access permissions table with no content.
- */
- public function testNodeAccessRebuildNoAccessModules() {
- // Default realm access is present.
- $this->assertEqual(1, \Drupal::service('node.grant_storage')->count(), 'There is an all realm access record');
-
- // No need to rebuild permissions.
- $this->assertFalse(\Drupal::state()->get('node.node_access_needs_rebuild'), 'Node access permissions need to be rebuilt');
-
- // Rebuild permissions.
- $this->drupalGet('admin/reports/status');
- $this->clickLink(t('Rebuild permissions'));
- $this->drupalPostForm(NULL, array(), t('Rebuild permissions'));
- $this->assertText(t('Content permissions have been rebuilt.'));
- $this->assertNull(\Drupal::state()->get('node.node_access_needs_rebuild'), 'Node access permissions have been rebuilt');
-
- // Default realm access is still present.
- $this->assertEqual(1, \Drupal::service('node.grant_storage')->count(), 'There is an all realm access record');
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
+++ b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php
@@ -7,6 +7,7 @@
namespace Drupal\node\Tests\Views;
+use Drupal\field\Entity\FieldStorageConfig;
use Drupal\language\Entity\ConfigurableLanguage;
/**
@@ -47,6 +48,12 @@ function setUp() {
ConfigurableLanguage::createFromLangcode('fr')->save();
ConfigurableLanguage::createFromLangcode('es')->save();
+ // Make the body field translatable. The title is already translatable by
+ // definition.
+ $field_storage = FieldStorageConfig::loadByName('node', 'body');
+ $field_storage->translatable = TRUE;
+ $field_storage->save();
+
// Set up node titles.
$this->node_titles = array(
'en' => 'Food in Paris',
only in patch2:
unchanged:
--- a/core/modules/rest/src/RequestHandler.php
+++ b/core/modules/rest/src/RequestHandler.php
@@ -31,13 +31,11 @@ class RequestHandler implements ContainerAwareInterface {
* The route match.
* @param \Symfony\Component\HttpFoundation\Request $request
* The HTTP request object.
- * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
- * The route match.
*
* @return \Symfony\Component\HttpFoundation\Response
* The response object.
*/
- public function handle(RouteMatchInterface $route_match, Request $request, RouteMatchInterface $route_match) {
+ public function handle(RouteMatchInterface $route_match, Request $request) {
$plugin = $route_match->getRouteObject()->getDefault('_plugin');
$method = strtolower($request->getMethod());
@@ -78,7 +76,7 @@ public function handle(RouteMatchInterface $route_match, Request $request, Route
// Determine the request parameters that should be passed to the resource
// plugin.
- $route_parameters = $route_match->getParameters();
+ $route_parameters = $request->attributes->get('_route_params');
$parameters = array();
// Filter out all internal parameters starting with "_".
foreach ($route_parameters as $key => $parameter) {
only in patch2:
unchanged:
--- a/core/modules/serialization/src/EntityResolver/ChainEntityResolver.php
+++ b/core/modules/serialization/src/EntityResolver/ChainEntityResolver.php
@@ -43,8 +43,7 @@ public function addResolver(EntityResolverInterface $resolver) {
*/
public function resolve(NormalizerInterface $normalizer, $data, $entity_type) {
foreach ($this->resolvers as $resolver) {
- $resolved = $resolver->resolve($normalizer, $data, $entity_type);
- if (isset($resolved)) {
+ if ($resolved = $resolver->resolve($normalizer, $data, $entity_type)) {
return $resolved;
}
}
only in patch2:
unchanged:
--- a/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php
+++ b/core/modules/serialization/tests/src/Unit/EntityResolver/ChainEntityResolverTest.php
@@ -111,23 +111,6 @@ public function testResolverWithLastResolved() {
}
/**
- * Test the resolve method where one resolver returns 0.
- *
- * @covers ::__construct
- * @covers ::resolve
- */
- public function testResolverWithResolvedToZero() {
- $resolvers = array(
- $this->createEntityResolverMock(0),
- $this->createEntityResolverMock(NULL, FALSE),
- );
-
- $resolver = new ChainEntityResolver($resolvers);
-
- $this->assertSame(0, $resolver->resolve($this->testNormalizer, $this->testData, $this->testEntityType));
- }
-
- /**
* Creates a mock entity resolver.
*
* @param null|int $return
only in patch2:
unchanged:
--- a/core/modules/system/entity.api.php
+++ b/core/modules/system/entity.api.php
@@ -893,8 +893,8 @@ function hook_ENTITY_TYPE_storage_load(array $entities) {
*/
function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
if ($entity instanceof ContentEntityInterface && $entity->isTranslatable()) {
- $route_match = \Drupal::routeMatch();
- \Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode'));
+ $attributes = \Drupal::request()->attributes;
+ \Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $attributes->get('source_langcode'));
}
}
@@ -909,8 +909,8 @@ function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
*/
function hook_ENTITY_TYPE_presave(Drupal\Core\Entity\EntityInterface $entity) {
if ($entity->isTranslatable()) {
- $route_match = \Drupal::routeMatch();
- \Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $route_match->getParameter('source_langcode'));
+ $attributes = \Drupal::request()->attributes;
+ \Drupal::service('content_translation.synchronizer')->synchronizeFields($entity, $entity->language()->getId(), $attributes->get('source_langcode'));
}
}
only in patch2:
unchanged:
--- a/core/modules/system/src/PathBasedBreadcrumbBuilder.php
+++ b/core/modules/system/src/PathBasedBreadcrumbBuilder.php
@@ -14,12 +14,10 @@
use Drupal\Core\Link;
use Drupal\Core\ParamConverter\ParamNotConvertedException;
use Drupal\Core\PathProcessor\InboundPathProcessorInterface;
-use Drupal\Core\Routing\RouteMatch;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Component\Utility\Unicode;
-use Drupal\Core\Url;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@@ -141,10 +139,9 @@ public function build(RouteMatchInterface $route_match) {
// Copy the path elements for up-casting.
$route_request = $this->getRequestForPath(implode('/', $path_elements), $exclude);
if ($route_request) {
- $route_match = RouteMatch::createFromRequest($route_request);
- $access = $this->accessManager->check($route_match, $this->currentUser);
+ $access = $this->accessManager->checkRequest($route_request, $this->currentUser);
if ($access) {
- $title = $this->titleResolver->getTitle($route_request, $route_match->getRouteObject());
+ $title = $this->titleResolver->getTitle($route_request, $route_request->attributes->get(RouteObjectInterface::ROUTE_OBJECT));
}
if ($access) {
if (!isset($title)) {
@@ -152,8 +149,7 @@ public function build(RouteMatchInterface $route_match) {
// route is missing a _title or _title_callback attribute.
$title = str_replace(array('-', '_'), ' ', Unicode::ucfirst(end($path_elements)));
}
- $url = Url::fromRouteMatch($route_match);
- $links[] = new Link($title, $url);
+ $links[] = Link::createFromRoute($title, $route_request->attributes->get(RouteObjectInterface::ROUTE_NAME), $route_request->attributes->get('_raw_variables')->all());
}
}
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/Common/AttachedAssetsTest.php
+++ b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php
@@ -375,28 +375,6 @@ function testLibraryAlter() {
}
/**
- * Dynamically defines an asset library and alters it.
- */
- function testDynamicLibrary() {
- /** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */
- $library_discovery = \Drupal::service('library.discovery');
- // Retrieve a dynamic library definition.
- // @see common_test_library_info_build()
- \Drupal::state()->set('common_test.library_info_build_test', TRUE);
- $library_discovery->clearCachedDefinitions();
- $dynamic_library = $library_discovery->getLibraryByName('common_test', 'dynamic_library');
- $this->assertTrue(is_array($dynamic_library));
- if ($this->assertTrue(isset($dynamic_library['version']))) {
- $this->assertIdentical('1.0', $dynamic_library['version']);
- }
- // Make sure the dynamic library definition could be altered.
- // @see common_test_library_info_alter()
- if ($this->assertTrue(isset($dynamic_library['dependencies']))) {
- $this->assertIdentical(['core/jquery'], $dynamic_library['dependencies']);
- }
- }
-
- /**
* Tests that multiple modules can implement libraries with the same name.
*
* @see common_test.library.yml
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
@@ -68,6 +68,7 @@ protected function setUp() {
'entity_type' => 'entity_test_mulrev',
'type' => $field_type,
'cardinality' => 2,
+ 'translatable' => TRUE,
));
$field_storage->save();
$field_storages[] = $field_storage;
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php
+++ b/core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php
@@ -267,35 +267,6 @@ public function testLoadTree() {
$this->assertTrue($tree['test4']['in_active_trail']);
$this->assertEqual(count($tree['test4']['subtree']['test5']['subtree']), 0);
$this->assertTrue($tree['test4']['subtree']['test5']['in_active_trail']);
-
- // Add some conditions to ensure that conditions work as expected.
- $parameters = new MenuTreeParameters();
- $parameters->addCondition('parent', 'test1');
- $data = $this->treeStorage->loadTreeData('tools', $parameters);
- $this->assertEqual(count($data['tree']), 1);
- $this->assertEqual($data['tree']['test2']['definition']['id'], 'test2');
- $this->assertEqual($data['tree']['test2']['subtree'], []);
-
- // Test for only enabled links.
- $link = $this->treeStorage->load('test3');
- $link['enabled'] = FALSE;
- $this->treeStorage->save($link);
- $link = $this->treeStorage->load('test4');
- $link['enabled'] = FALSE;
- $this->treeStorage->save($link);
- $link = $this->treeStorage->load('test5');
- $link['enabled'] = FALSE;
- $this->treeStorage->save($link);
-
- $parameters = new MenuTreeParameters();
- $parameters->onlyEnabledLinks();
- $data = $this->treeStorage->loadTreeData('tools', $parameters);
- $this->assertEqual(count($data['tree']), 1);
- $this->assertEqual($data['tree']['test1']['definition']['id'], 'test1');
- $this->assertEqual(count($data['tree']['test1']['subtree']), 1);
- $this->assertEqual($data['tree']['test1']['subtree']['test2']['definition']['id'], 'test2');
- $this->assertEqual($data['tree']['test1']['subtree']['test2']['subtree'], []);
-
}
/**
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php
+++ b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php
@@ -104,7 +104,7 @@ function testSiteMaintenance() {
$edit = array(
'name' => $this->user->getUsername(),
);
- $this->drupalPostForm('user/password', $edit, t('Submit'));
+ $this->drupalPostForm('user/password', $edit, t('Email new password'));
$mails = $this->drupalGetMails();
$start = strpos($mails[0]['body'], 'user/reset/'. $this->user->id());
$path = substr($mails[0]['body'], $start, 66 + strlen($this->user->id()));
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/common_test/common_test.module
+++ b/core/modules/system/tests/modules/common_test/common_test.module
@@ -165,22 +165,6 @@ function common_test_preprocess_common_test_render_element(&$variables) {
}
/**
- * Implements hook_library_info_build().
- */
-function common_test_library_info_build() {
- $libraries = [];
- if (\Drupal::state()->get('common_test.library_info_build_test')) {
- $libraries['dynamic_library'] = [
- 'version' => '1.0',
- 'css' => [
- 'common_test.css' => [],
- ],
- ];
- }
- return $libraries;
-}
-
-/**
* Implements hook_library_info_alter().
*/
function common_test_library_info_alter(&$libraries, $module) {
@@ -190,13 +174,6 @@ function common_test_library_info_alter(&$libraries, $module) {
// Make Farbtastic depend on jQuery Form to test library dependencies.
$libraries['jquery.farbtastic']['dependencies'][] = 'core/jquery.form';
}
-
- // Alter the dynamically registered library definition.
- if ($module == 'common_test' && isset($libraries['dynamic_library'])) {
- $libraries['dynamic_library']['dependencies'] = [
- 'core/jquery',
- ];
- }
}
/**
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php
+++ b/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php
@@ -10,8 +10,8 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Entity\Query\QueryFactory;
-use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Request;
/**
* Controller routines for entity_test routes.
@@ -65,8 +65,8 @@ public function testAdd($entity_type_id) {
/**
* Displays the 'Edit existing entity_test' form.
*
- * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
- * The route match object to get entity type from.
+ * @param \Symfony\Component\HttpFoundation\Request $request
+ * The request object to get entity type from.
* @param string $entity_type_id
* The entity type ID.
*
@@ -75,8 +75,8 @@ public function testAdd($entity_type_id) {
*
* @see \Drupal\entity_test\Routing\EntityTestRoutes::routes()
*/
- public function testEdit(RouteMatchInterface $route_match, $entity_type_id) {
- $entity = $route_match->getParameter($entity_type_id);
+ public function testEdit(Request $request, $entity_type_id) {
+ $entity = $request->attributes->get($entity_type_id);
$form = $this->entityFormBuilder()->getForm($entity);
$form['#title'] = $entity->label();
return $form;
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/form_test/src/FormTestControllerObject.php
+++ b/core/modules/system/tests/modules/form_test/src/FormTestControllerObject.php
@@ -10,7 +10,6 @@
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\Request;
/**
* Provides a test form object.
@@ -35,11 +34,11 @@ public static function create(ContainerInterface $container) {
/**
* {@inheritdoc}
*/
- public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL, $custom_attributes = NULL) {
+ public function buildForm(array $form, FormStateInterface $form_state, $custom_attributes = NULL) {
$form['element'] = array('#markup' => 'The FormTestControllerObject::buildForm() method was used for this form.');
$form['custom_attribute']['#markup'] = $custom_attributes;
- $form['request_attribute']['#markup'] = $request->attributes->get('request_attribute');
+ $form['request_attribute']['#markup'] = $this->getRequest()->attributes->get('request_attribute');
$form['bananas'] = array(
'#type' => 'textfield',
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php
+++ b/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php
@@ -9,13 +9,15 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\node\NodeInterface;
+use Symfony\Component\HttpFoundation\Request;
/**
* Controller routine for testing the paramconverter.
*/
class TestControllers {
- public function testUserNodeFoo(EntityInterface $user, NodeInterface $node, $foo) {
+ public function testUserNodeFoo(EntityInterface $user, NodeInterface $node, Request $request) {
+ $foo = $request->attributes->get('foo');
$foo = is_object($foo) ? $foo->label() : $foo;
return ['#markup' => "user: {$user->label()}, node: {$node->label()}, foo: $foo"];
}
only in patch2:
unchanged:
--- a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
+++ b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
@@ -326,8 +326,8 @@ public function testBuildWithUserPath() {
*/
public function setupAccessManagerToAllow() {
$this->accessManager->expects($this->any())
- ->method('check')
- ->willReturn(TRUE);
+ ->method('checkRequest')
+ ->will($this->returnValue(AccessResult::allowed()));
}
protected function setupStubPathProcessor() {
only in patch2:
unchanged:
--- a/core/modules/system/theme.api.php
+++ b/core/modules/system/theme.api.php
@@ -722,70 +722,6 @@ function hook_js_alter(&$javascript) {
}
/**
- * Add dynamic library definitions.
- *
- * Modules may implement this hook to add dynamic library definitions. Static
- * libraries, which do not depend on any runtime information, should be declared
- * in a modulename.libraries.yml file instead.
- *
- * @return array[]
- * An array of library definitions to register, keyed by library ID. The
- * library ID will be prefixed with the module name automatically.
- *
- * @see core.libraries.yml
- * @see hook_library_info_alter()
- */
-function hook_library_info_build() {
- $libraries = [];
- // Add a library whose information changes depending on certain conditions.
- $libraries['mymodule.zombie'] = [
- 'dependencies' => [
- 'core/backbone',
- ],
- ];
- if (Drupal::moduleHandler()->moduleExists('minifyzombies')) {
- $libraries['mymodule.zombie'] += [
- 'js' => [
- 'mymodule.zombie.min.js' => [],
- ],
- 'css' => [
- 'mymodule.zombie.min.css' => [],
- ],
- ];
- }
- else {
- $libraries['mymodule.zombie'] += [
- 'js' => [
- 'mymodule.zombie.js' => [],
- ],
- 'css' => [
- 'mymodule.zombie.css' => [],
- ],
- ];
- }
-
- // Add a library only if a certain condition is met. If code wants to
- // integrate with this library it is safe to (try to) load it unconditionally
- // without reproducing this check. If the library definition does not exist
- // the library (of course) not be loaded but no notices or errors will be
- // triggered.
- if (Drupal::moduleHandler()->moduleExists('vampirize')) {
- $libraries['mymodule.vampire'] = [
- 'js' => [
- 'js/vampire.js' => [],
- ],
- 'css' => [
- 'css/vampire.css',
- ],
- 'dependencies' => [
- 'core/jquery',
- ],
- ];
- }
- return $libraries;
-}
-
-/**
* Perform necessary alterations to the JavaScript settings (drupalSettings).
*
* @param array &$settings
only in patch2:
unchanged:
--- a/core/modules/taxonomy/config/schema/taxonomy.views.schema.yml
+++ b/core/modules/taxonomy/config/schema/taxonomy.views.schema.yml
@@ -148,17 +148,29 @@ views.filter.taxonomy_index_tid:
error_message:
type: boolean
label: 'Display error message'
+
+views.filter.taxonomy_index_tid_depth:
+ type: views.filter.in_operator
+ label: 'Taxonomy term ID with depth'
+ mapping:
+ operator:
+ type: string
+ label: 'Operator'
value:
type: sequence
label: 'Values'
sequence:
- - type: integer
+ - type: string
label: 'Value'
-
-views.filter.taxonomy_index_tid_depth:
- type: views.filter.taxonomy_index_tid
- label: 'Taxonomy term ID with depth'
- mapping:
+ vid:
+ type: string
+ label: 'Vocabulary'
+ type:
+ type: string
+ label: 'Selection type'
+ hierarchy:
+ type: boolean
+ label: 'Show hierarchy in dropdown'
depth:
type: integer
label: 'Depth'
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
@@ -8,7 +8,6 @@
namespace Drupal\taxonomy\Plugin\views\argument_default;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\taxonomy\TermInterface;
use Drupal\views\Plugin\CacheablePluginInterface;
use Drupal\views\ViewExecutable;
@@ -29,44 +28,6 @@
class Tid extends ArgumentDefaultPluginBase implements CacheablePluginInterface {
/**
- * The route match.
- *
- * @var \Drupal\Core\Routing\RouteMatchInterface
- */
- protected $routeMatch;
-
- /**
- * Constructs a new Date instance.
- *
- * @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\RouteMatchInterface $route_match
- * The route match.
- */
- public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match) {
- parent::__construct($configuration, $plugin_id, $plugin_definition);
-
- $this->routeMatch = $route_match;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('current_route_match')
- );
- }
-
- /**
* Overrides \Drupal\views\Plugin\views\Plugin\views\PluginBase::init().
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
@@ -165,14 +126,14 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state, &$opti
public function getArgument() {
// Load default argument from taxonomy page.
if (!empty($this->options['term_page'])) {
- if (($taxonomy_term = $this->routeMatch->getParameter('taxonomy_term')) && $taxonomy_term instanceof TermInterface) {
+ if (($taxonomy_term = $this->view->getRequest()->attributes->get('taxonomy_term')) && $taxonomy_term instanceof TermInterface) {
return $taxonomy_term->id();
}
}
// Load default argument from node.
if (!empty($this->options['node'])) {
// Just check, if a node could be detected.
- if (($node = $this->routeMatch->getParameter('node')) && $node instanceof NodeInterface) {
+ if (($node = $this->view->getRequest()->attributes->get('node')) && $node instanceof NodeInterface) {
$taxonomy = array();
foreach ($node->getFieldDefinitions() as $field) {
if ($field->getType() == 'taxonomy_term_reference') {
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
+++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php
@@ -66,6 +66,7 @@ function setUp() {
'entity_type' => 'taxonomy_term',
'type' => 'text',
));
+ $field->translatable = TRUE;
$field->save();
entity_create('field_config', array(
'field_name' => 'field_foo',
only in patch2:
unchanged:
--- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml
+++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml
@@ -136,7 +136,7 @@ display:
admin_label: ''
operator: or
value:
- - 2
+ - '2'
group: 1
exposed: false
expose:
only in patch2:
unchanged:
--- a/core/modules/tour/css/tour.module.css
+++ b/core/modules/tour/css/tour.module.css
@@ -109,13 +109,6 @@
bottom: auto;
}
-.joyride-tip-guide .joyride-nub.top-right {
- top: -28px;
- bottom: auto;
- left: auto;
- right: 28px;
-}
-
.joyride-tip-guide p {
margin: 0 0 1.4em;
}
@@ -152,15 +145,3 @@
left: 0;
cursor: pointer;
}
-
-.joyride-expose-wrapper {
- position: absolute;
- z-index: 102;
-}
-
-.joyride-expose-cover {
- position: absolute;
- z-index: 10000;
- top: 0;
- left: 0;
-}
only in patch2:
unchanged:
--- a/core/modules/tour/js/tour.js
+++ b/core/modules/tour/js/tour.js
@@ -102,7 +102,6 @@
var that = this;
if ($tour.find('li').length) {
$tour.joyride({
- autoStart: true,
postRideCallback: function () { that.model.set('isActive', false); },
template: { // HTML segments for tip layout
link: '×',
only in patch2:
unchanged:
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -119,8 +119,7 @@ function update_help($route_name, RouteMatchInterface $route_match) {
function update_page_top() {
/** @var \Drupal\Core\Routing\AdminContext $admin_context */
$admin_context = \Drupal::service('router.admin_context');
- $route_match = \Drupal::routeMatch();
- if ($admin_context->isAdminRoute($route_match->getRouteObject()) && \Drupal::currentUser()->hasPermission('administer site configuration')) {
+ if ($admin_context->isAdminRoute(\Drupal::request()->attributes->get(RouteObjectInterface::ROUTE_OBJECT)) && \Drupal::currentUser()->hasPermission('administer site configuration')) {
$route_name = \Drupal::routeMatch()->getRouteName();
switch ($route_name) {
// These pages don't need additional nagging.
only in patch2:
unchanged:
--- a/core/modules/user/src/AccountForm.php
+++ b/core/modules/user/src/AccountForm.php
@@ -134,16 +134,8 @@ public function form(array $form, FormStateInterface $form_state) {
if (!$pass_reset) {
$protected_values['mail'] = $form['account']['mail']['#title'];
$protected_values['pass'] = $this->t('Password');
- $request_new = $this->l($this->t('Reset your password'), new Url('user.pass',
- array(), array('attributes' => array('title' => $this->t('Send password reset instructions via e-mail.'))))
- );
- $current_pass_description = $this->t('Required if you want to change the %mail or %pass below. !request_new.',
- array(
- '%mail' => $protected_values['mail'],
- '%pass' => $protected_values['pass'],
- '!request_new' => $request_new,
- )
- );
+ $request_new = $this->l($this->t('Request new password'), new Url('user.pass', array(), array('attributes' => array('title' => $this->t('Request new password via email.')))));
+ $current_pass_description = $this->t('Required if you want to change the %mail or %pass below. !request_new.', array('%mail' => $protected_values['mail'], '%pass' => $protected_values['pass'], '!request_new' => $request_new));
}
// The user must enter their current password to change to a new one.
only in patch2:
unchanged:
--- a/core/modules/user/src/Form/UserPasswordForm.php
+++ b/core/modules/user/src/Form/UserPasswordForm.php
@@ -92,20 +92,15 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$form['name']['#value'] = $user->getEmail();
$form['mail'] = array(
'#prefix' => '',
- '#markup' => $this->t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the email.', array('%email' => $user->getEmail())),
+ '#markup' => $this->t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the email.', array('%email' => $user->getEmail())),
'#suffix' => '
',
);
}
else {
- $form['mail'] = array(
- '#prefix' => '',
- '#markup' => $this->t('Password reset instructions will be sent to your registered e-mail address.'),
- '#suffix' => '
',
- );
$form['name']['#default_value'] = $this->getRequest()->query->get('name');
}
$form['actions'] = array('#type' => 'actions');
- $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->t('Submit'));
+ $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->t('Email new password'));
return $form;
}
only in patch2:
unchanged:
--- a/core/modules/user/src/Plugin/Block/UserLoginBlock.php
+++ b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
@@ -7,13 +7,11 @@
namespace Drupal\user\Plugin\Block;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
-use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Routing\UrlGeneratorTrait;
use Drupal\Core\Url;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Block\BlockBase;
-use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Cmf\Component\Routing\RouteObjectInterface;
/**
* Provides a 'User login' block.
@@ -24,56 +22,15 @@
* category = @Translation("Forms")
* )
*/
-class UserLoginBlock extends BlockBase implements ContainerFactoryPluginInterface {
+class UserLoginBlock extends BlockBase {
use UrlGeneratorTrait;
/**
- * The route match.
- *
- * @var \Drupal\Core\Routing\RouteMatchInterface
- */
- protected $routeMatch;
-
- /**
- * Constructs a new UserLoginBlock instance.
- *
- * @param array $configuration
- * The plugin configuration, i.e. an array with configuration values keyed
- * by configuration option name. The special key 'context' may be used to
- * initialize the defined contexts by setting it to an array of context
- * values keyed by context names.
- * @param string $plugin_id
- * The plugin_id for the plugin instance.
- * @param mixed $plugin_definition
- * The plugin implementation definition.
- * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
- * The route match.
- */
- public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match) {
- parent::__construct($configuration, $plugin_id, $plugin_definition);
-
- $this->routeMatch = $route_match;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('current_route_match')
- );
- }
-
-
- /**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
- $route_name = $this->routeMatch->getRouteName();
+ $route_name = \Drupal::request()->attributes->get(RouteObjectInterface::ROUTE_NAME);
return ($account->isAnonymous() && !in_array($route_name, array('user.register', 'user.login', 'user.logout')));
}
@@ -98,9 +55,9 @@ public function build() {
),
)));
}
- $items['request_password'] = \Drupal::l(t('Reset your password'), new Url('user.pass', array(), array(
+ $items['request_password'] = \Drupal::l(t('Request new password'), new Url('user.pass', array(), array(
'attributes' => array(
- 'title' => t('Send password reset instructions via e-mail.'),
+ 'title' => t('Request new password via email.'),
'class' => array('request-password-link'),
),
)));
only in patch2:
unchanged:
--- a/core/modules/user/src/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php
+++ b/core/modules/user/src/Plugin/LanguageNegotiation/LanguageNegotiationUserAdmin.php
@@ -10,8 +10,6 @@
use Drupal\Core\PathProcessor\PathProcessorManager;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Routing\AdminContext;
-use Drupal\Core\Routing\RouteMatch;
-use Drupal\Core\Routing\StackedRouteMatchInterface;
use Drupal\language\LanguageNegotiationMethodBase;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -63,13 +61,6 @@ class LanguageNegotiationUserAdmin extends LanguageNegotiationMethodBase impleme
protected $pathProcessorManager;
/**
- * The stacked route match.
- *
- * @var \Drupal\Core\Routing\StackedRouteMatchInterface
- */
- protected $stackedRouteMatch;
-
- /**
* Constructs a new LanguageNegotiationUserAdmin instance.
*
* @param \Drupal\Core\Routing\AdminContext $admin_context
@@ -78,14 +69,11 @@ class LanguageNegotiationUserAdmin extends LanguageNegotiationMethodBase impleme
* The router.
* @param \Drupal\Core\PathProcessor\PathProcessorManager $path_processor_manager
* The path processor manager.
- * @param \Drupal\Core\Routing\StackedRouteMatchInterface $stacked_route_match
- * The stacked route match.
*/
- public function __construct(AdminContext $admin_context, UrlMatcherInterface $router, PathProcessorManager $path_processor_manager, StackedRouteMatchInterface $stacked_route_match) {
+ public function __construct(AdminContext $admin_context, UrlMatcherInterface $router, PathProcessorManager $path_processor_manager) {
$this->adminContext = $admin_context;
$this->router = $router;
$this->pathProcessorManager = $path_processor_manager;
- $this->stackedRouteMatch = $stacked_route_match;
}
/**
@@ -95,8 +83,7 @@ public static function create(ContainerInterface $container, array $configuratio
return new static(
$container->get('router.admin_context'),
$container->get('router'),
- $container->get('path_processor_manager'),
- $container->get('current_route_match')
+ $container->get('path_processor_manager')
);
}
@@ -130,8 +117,7 @@ protected function isAdminPath(Request $request) {
// If called from an event subscriber, the request may not have the route
// object yet (it is still being built), so use the router to look up
// based on the path.
- $route_match = $this->stackedRouteMatch->getRouteMatchFromRequest($request);
- if ($route_match && !$route_object = $route_match->getRouteObject()) {
+ if (!$route_object = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT)) {
try {
// Process the path as an inbound path. This will remove any language
// prefixes and other path components that inbound processing would
only in patch2:
unchanged:
--- a/core/modules/user/src/Plugin/views/argument_default/User.php
+++ b/core/modules/user/src/Plugin/views/argument_default/User.php
@@ -8,7 +8,6 @@
namespace Drupal\user\Plugin\views\argument_default;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\Plugin\CacheablePluginInterface;
use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -27,44 +26,6 @@
class User extends ArgumentDefaultPluginBase implements CacheablePluginInterface {
/**
- * The route match.
- *
- * @var \Drupal\Core\Routing\RouteMatchInterface
- */
- protected $routeMatch;
-
- /**
- * Constructs a new Date instance.
- *
- * @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\RouteMatchInterface $route_match
- * The route match.
- */
- public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match) {
- parent::__construct($configuration, $plugin_id, $plugin_definition);
-
- $this->routeMatch = $route_match;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('current_route_match')
- );
- }
-
- /**
* {@inheritdoc}
*/
protected function defineOptions() {
@@ -91,14 +52,16 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
public function getArgument() {
// If there is a user object in the current route.
- if ($user = $this->routeMatch->getParameter('user')) {
+ if ($this->view->getRequest()->attributes->has('user')) {
+ $user = $this->view->getRequest()->attributes->get('user');
if ($user instanceof UserInterface) {
return $user->id();
}
}
// If option to use node author; and node in current route.
- if (!empty($this->options['user']) && $node = $this->routeMatch->getParameter('node')) {
+ if (!empty($this->options['user']) && $this->view->getRequest()->attributes->has('node')) {
+ $node = $this->view->getRequest()->attributes->get('node');
if ($node instanceof NodeInterface) {
return $node->getOwnerId();
}
only in patch2:
unchanged:
--- a/core/modules/user/src/Tests/UserAccountLinksTests.php
+++ b/core/modules/user/src/Tests/UserAccountLinksTests.php
@@ -131,7 +131,7 @@ function testAccountPageTitles() {
$this->assertTitle('Create new account' . $title_suffix, "Page title of /user/register is 'Create new account' for anonymous users.");
$this->drupalGet('user/password');
- $this->assertTitle('Reset your password' . $title_suffix, "Page title of /user/register is 'Reset your password' for anonymous users.");
+ $this->assertTitle('Request new password' . $title_suffix, "Page title of /user/register is 'Request new password' for anonymous users.");
// Check the page title for registered users is "My Account" in menus.
$this->drupalLogin($this->drupalCreateUser());
only in patch2:
unchanged:
--- a/core/modules/user/src/Tests/UserPasswordResetTest.php
+++ b/core/modules/user/src/Tests/UserPasswordResetTest.php
@@ -63,14 +63,14 @@ function testUserPasswordReset() {
$this->drupalGet('user/password');
$edit = array('name' => $this->randomMachineName(32));
- $this->drupalPostForm(NULL, $edit, t('Submit'));
+ $this->drupalPostForm(NULL, $edit, t('Email new password'));
$this->assertText(t('Sorry, @name is not recognized as a username or an email address.', array('@name' => $edit['name'])), 'Validation error message shown when trying to request password for invalid account.');
$this->assertEqual(count($this->drupalGetMails(array('id' => 'user_password_reset'))), 0, 'No email was sent when requesting a password for an invalid account.');
// Reset the password by username via the password reset page.
$edit['name'] = $this->account->getUsername();
- $this->drupalPostForm(NULL, $edit, t('Submit'));
+ $this->drupalPostForm(NULL, $edit, t('Email new password'));
// Verify that the user was sent an email.
$this->assertMail('to', $this->account->getEmail(), 'Password email sent to user.');
@@ -109,7 +109,7 @@ function testUserPasswordReset() {
// Count email messages before to compare with after.
$before = count($this->drupalGetMails(array('id' => 'user_password_reset')));
$edit = array('name' => $this->account->getEmail());
- $this->drupalPostForm(NULL, $edit, t('Submit'));
+ $this->drupalPostForm(NULL, $edit, t('Email new password'));
$this->assertTrue( count($this->drupalGetMails(array('id' => 'user_password_reset'))) === $before + 1, 'Email sent when requesting password reset using email address.');
// Create a password reset link as if the request time was 60 seconds older than the allowed limit.
only in patch2:
unchanged:
--- a/core/modules/user/user.links.task.yml
+++ b/core/modules/user/user.links.task.yml
@@ -21,7 +21,7 @@ user.register:
user.pass:
route_name: user.pass
base_route: user.page
- title: 'Reset your password'
+ title: 'Request new password'
# Other authentication methods may add pages below user/login/.
user.login:
route_name: user.login
only in patch2:
unchanged:
--- a/core/modules/user/user.routing.yml
+++ b/core/modules/user/user.routing.yml
@@ -119,7 +119,7 @@ user.pass:
path: '/user/password'
defaults:
_form: '\Drupal\user\Form\UserPasswordForm'
- _title: 'Reset your password'
+ _title: 'Request new password'
requirements:
_access: 'TRUE'
options:
only in patch2:
unchanged:
--- a/core/modules/views/config/schema/views.filter.schema.yml
+++ b/core/modules/views/config/schema/views.filter.schema.yml
@@ -101,9 +101,18 @@ views.filter.many_to_one:
type: views.filter.in_operator
label: 'Many to one'
mapping:
+ operator:
+ type: string
+ label: 'Operator'
reduce_duplicates:
type: boolean
label: 'Reduce duplicate'
+ value:
+ type: sequence
+ label: 'Values'
+ sequence:
+ - type: string
+ label: 'Value'
views.filter.standard:
type: views_filter
@@ -131,3 +140,7 @@ views.filter_value.combine:
views.filter.language:
type: views.filter.in_operator
label: 'Language'
+
+views.filter_value.language:
+ type: string
+ label: 'Language'
only in patch2:
unchanged:
--- a/core/modules/views/src/Plugin/views/argument/Date.php
+++ b/core/modules/views/src/Plugin/views/argument/Date.php
@@ -9,8 +9,6 @@
use Drupal\Core\Database\Database;
use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
-use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\node\NodeInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -31,7 +29,7 @@
*
* @ViewsArgument("date")
*/
-class Date extends Formula implements ContainerFactoryPluginInterface {
+class Date extends Formula {
/**
* The date format used in the title.
@@ -50,44 +48,6 @@ class Date extends Formula implements ContainerFactoryPluginInterface {
var $option_name = 'default_argument_date';
/**
- * The route match.
- *
- * @var \Drupal\Core\Routing\RouteMatchInterface
- */
- protected $routeMatch;
-
- /**
- * Constructs a new Date instance.
- *
- * @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\RouteMatchInterface $route_match
- * The route match.
- */
- public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match) {
- parent::__construct($configuration, $plugin_id, $plugin_definition);
-
- $this->routeMatch = $route_match;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('current_route_match')
- );
- }
-
- /**
* Add an option to set the default value to the current date.
*/
public function defaultArgumentForm(&$form, FormStateInterface $form_state) {
@@ -106,7 +66,7 @@ public function getDefaultArgument($raw = FALSE) {
return date($this->argFormat, REQUEST_TIME);
}
elseif (!$raw && in_array($this->options['default_argument_type'], array('node_created', 'node_changed'))) {
- $node = $this->routeMatch->getParameter('node');
+ $node = $this->view->getRequest()->attributes->get('node');
if (!($node instanceof NodeInterface)) {
return parent::getDefaultArgument();
only in patch2:
unchanged:
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -2582,7 +2582,7 @@ public function getSpecialBlocks() {
*/
public function viewExposedFormBlocks() {
// Avoid interfering with the admin forms.
- $route_name = \Drupal::routeMatch()->getRouteName();
+ $route_name = \Drupal::request()->attributes->get(RouteObjectInterface::ROUTE_NAME);
if (strpos($route_name, 'views_ui.') === 0) {
return;
}
only in patch2:
unchanged:
--- a/core/modules/views/src/Plugin/views/field/Field.php
+++ b/core/modules/views/src/Plugin/views/field/Field.php
@@ -739,7 +739,7 @@ public function getItems(ResultRow $values) {
if (!$original_entity) {
return array();
}
- $entity = $this->process_entity($values, $original_entity);
+ $entity = $this->process_entity($original_entity);
if (!$entity) {
return array();
}
@@ -781,15 +781,13 @@ public function getItems(ResultRow $values) {
* Replaces values with aggregated values if aggregation is enabled.
* Takes delta settings into account (@todo remove in #1758616).
*
- * @param \Drupal\views\ResultRow $values
- * The result row object containing the values.
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to be processed.
*
* @return
* TRUE if the processing completed successfully, otherwise FALSE.
*/
- function process_entity(ResultRow $values, EntityInterface $entity) {
+ function process_entity(EntityInterface $entity) {
$processed_entity = clone $entity;
$langcode = $this->field_langcode($processed_entity);
only in patch2:
unchanged:
--- a/core/modules/views/src/Tests/Handler/FieldGroupRowsTest.php
+++ /dev/null
@@ -1,95 +0,0 @@
-drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
-
- // Create the unlimited text field.
- $field_storage = entity_create('field_storage_config', array(
- 'field_name' => $this->fieldName,
- 'entity_type' => 'node',
- 'type' => 'text',
- 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
- ));
- $field_storage->save();
-
- // Create an instance of the text field on the content type.
- $field = array(
- 'field_storage' => $field_storage,
- 'bundle' => $node_type->type,
- );
- entity_create('field_config', $field)->save();
-
- $this->container->get('views.views_data')->clear();
- }
-
- /**
- * Testing the "Grouped rows" functionality.
- */
- public function testGroupRows() {
- $edit = array(
- 'title' => $this->randomMachineName(),
- $this->fieldName => array('a', 'b', 'c'),
- );
- $this->drupalCreateNode($edit);
-
- $view = Views::getView('test_group_rows');
-
- // Test grouped rows.
- $this->executeView($view);
- $this->assertEqual($view->field[$this->fieldName]->advancedRender($view->result[0]), 'a, b, c');
-
- // Change the group_rows checkbox to false.
- $view = Views::getView('test_group_rows');
- $view->setHandlerOption('default', 'field', $this->fieldName, 'group_rows', FALSE);
-
- // Test ungrouped rows.
- $this->executeView($view);
- $this->assertEqual($view->field[$this->fieldName]->advancedRender($view->result[0]), 'a');
- $this->assertEqual($view->field[$this->fieldName]->advancedRender($view->result[1]), 'b');
- $this->assertEqual($view->field[$this->fieldName]->advancedRender($view->result[2]), 'c');
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_group_rows.yml
+++ /dev/null
@@ -1,104 +0,0 @@
-langcode: und
-status: true
-dependencies:
- module:
- - field
- - node
-id: test_group_rows
-label: test_group_rows
-module: views
-description: ''
-tag: ''
-base_table: node
-base_field: nid
-core: 8.x
-display:
- default:
- display_plugin: default
- id: default
- display_title: Master
- position: 0
- display_options:
- access:
- type: perm
- cache:
- type: none
- query:
- type: views_query
- exposed_form:
- type: basic
- pager:
- options:
- items_per_page: 10
- type: full
- style:
- type: default
- row:
- type: fields
- fields:
- field_group_rows:
- id: field_group_rows
- table: node__field_group_rows
- field: field_group_rows
- relationship: none
- group_type: group
- admin_label: ''
- label: ''
- exclude: false
- alter:
- alter_text: false
- text: ''
- make_link: false
- path: ''
- absolute: false
- external: false
- replace_spaces: false
- path_case: none
- trim_whitespace: true
- alt: ''
- rel: ''
- link_class: ''
- prefix: ''
- suffix: ''
- target: ''
- nl2br: false
- max_length: ''
- word_boundary: true
- ellipsis: true
- more_link: false
- more_link_text: ''
- more_link_path: ''
- strip_tags: true
- trim: true
- preserve_tags: ''
- html: false
- element_type: ''
- element_class: ''
- element_label_type: ''
- element_label_class: ''
- element_label_colon: false
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- click_sort_column: value
- type: string
- settings:
- link_to_entity: '0'
- group_column: value
- group_columns: { }
- group_rows: true
- delta_limit: all
- delta_offset: '0'
- delta_reversed: false
- delta_first_last: false
- multi_type: separator
- separator: ', '
- field_api_classes: false
- plugin_id: field
- field_langcode: '***LANGUAGE_language_content***'
- field_langcode_add_to_query: null
- display_extenders: { }
only in patch2:
unchanged:
--- a/core/profiles/standard/config/install/field.storage.user.user_picture.yml
+++ b/core/profiles/standard/config/install/field.storage.user.user_picture.yml
@@ -15,6 +15,7 @@ settings:
module: image
locked: false
cardinality: 1
+translatable: false
indexes:
target_id:
- target_id
only in patch2:
unchanged:
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
@@ -161,7 +161,7 @@ public function testInvalidLibrariesFile() {
* Tests that an exception is thrown when no CSS/JS/setting is specified.
*
* @expectedException \Drupal\Core\Asset\Exception\IncompleteLibraryDefinitionException
- * @expectedExceptionMessage Incomplete library definition for definition 'example' in extension 'example_module_missing_information'
+ * @expectedExceptionMessage Incomplete library definition for 'example' in core/tests/Drupal/Tests/Core/Asset/library_test_files/example_module_missing_information.libraries.yml
*
* @covers ::buildByExtension
*/
@@ -400,7 +400,7 @@ public function testLibraryWithJavaScript() {
* Tests that an exception is thrown when license is missing when 3rd party.
*
* @expectedException \Drupal\Core\Asset\Exception\LibraryDefinitionMissingLicenseException
- * @expectedExceptionMessage Missing license information in library definition for definition 'no-license-info-but-remote' extension 'licenses_missing_information': it has a remote, but no license.
+ * @expectedExceptionMessage Missing license information in library definition for 'no-license-info-but-remote' in core/tests/Drupal/Tests/Core/Asset/library_test_files/licenses_missing_information.libraries.yml: it has a remote, but no license.
*
* @covers ::buildByExtension
*/
@@ -434,6 +434,7 @@ public function testLibraryWithLicenses() {
$libraries = $this->libraryDiscoveryParser->buildByExtension('licenses');
+
// For libraries without license info, the default license is applied.
$library = $libraries['no-license-info'];
$this->assertCount(1, $library['css']);
only in patch2:
unchanged:
--- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
@@ -74,8 +74,8 @@ public function testGetArguments() {
));
$arguments = $this->controllerResolver->getArguments($request, $controller);
- $this->assertEquals($mock_entity, $arguments[0]);
- $this->assertEquals($mock_account, $arguments[1]);
+ $this->assertEquals($mock_entity, $arguments[0], 'Type hinted variables should use upcasted values.');
+ $this->assertEquals(1, $arguments[1], 'Not type hinted variables should use not upcasted values.');
$this->assertEquals(RouteMatch::createFromRequest($request), $arguments[2], 'Ensure that the route match object is passed along as well');
}
only in patch2:
unchanged:
--- a/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php
+++ b/core/tests/Drupal/Tests/Core/Menu/StaticMenuLinkOverridesTest.php
@@ -22,7 +22,7 @@ class StaticMenuLinkOverridesTest extends UnitTestCase {
* @covers ::__construct
*/
public function testConstruct() {
- $config_factory = $this->getConfigFactoryStub(array('core.menu.static_menu_link_overrides' => array()));
+ $config_factory = $this->getConfigFactoryStub(array('menu_link.static.overrides' => array()));
$static_override = new StaticMenuLinkOverrides($config_factory);
$this->assertAttributeEquals($config_factory, 'configFactory', $static_override);
@@ -37,7 +37,7 @@ public function testReload() {
$config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
$config_factory->expects($this->at(0))
->method('reset')
- ->with('core.menu.static_menu_link_overrides');
+ ->with('menu_link.static.overrides');
$static_override = new StaticMenuLinkOverrides($config_factory);
@@ -53,7 +53,7 @@ public function testReload() {
* @covers ::getConfig
*/
public function testLoadOverride($overrides, $id, $expected) {
- $config_factory = $this->getConfigFactoryStub(array('core.menu.static_menu_link_overrides' => array('definitions' => $overrides)));
+ $config_factory = $this->getConfigFactoryStub(array('menu_link.static.overrides' => array('definitions' => $overrides)));
$static_override = new StaticMenuLinkOverrides($config_factory);
$this->assertEquals($expected, $static_override->loadOverride($id));
@@ -88,7 +88,7 @@ public function testLoadMultipleOverrides() {
$overrides['test2'] = array('parent' => 'test1');
$overrides['test1__la___ma'] = array('parent' => 'test2');
- $config_factory = $this->getConfigFactoryStub(array('core.menu.static_menu_link_overrides' => array('definitions' => $overrides)));
+ $config_factory = $this->getConfigFactoryStub(array('menu_link.static.overrides' => array('definitions' => $overrides)));
$static_override = new StaticMenuLinkOverrides($config_factory);
$this->assertEquals(array('test1' => array('parent' => 'test0'), 'test1.la__ma' => array('parent' => 'test2')), $static_override->loadMultipleOverrides(array('test1', 'test1.la__ma')));
only in patch2:
unchanged:
--- a/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
@@ -78,38 +78,4 @@ public function testGetCurrentRouteObject() {
$this->assertSame('1', $current_route_match->getParameter('foo'));
}
- /**
- * @covers ::getRouteMatchFromRequest
- */
- public function testGetRouteMatchFromRequestWithRouting() {
- $request_stack = new RequestStack();
- $request = new Request();
- $request_stack->push($request);
- $current_route_match = new CurrentRouteMatch($request_stack);
-
- $route_match = $current_route_match->getRouteMatchFromRequest($request);
-
- $this->assertNull($route_match->getRouteName());
- $this->assertNull($route_match->getRouteObject());
- }
-
- /**
- * @covers ::getRouteMatchFromRequest
- */
- public function testGetRouteMatchFromRequest() {
- $request_stack = new RequestStack();
- $request = new Request();
- $request_stack->push($request);
- $route = new Route('/test-route/{foo}');
-
- $request->attributes->set(RouteObjectInterface::ROUTE_NAME, 'test_route');
- $request->attributes->set(RouteObjectInterface::ROUTE_OBJECT, $route);
- $request->attributes->set('foo', '1');
- $current_route_match = new CurrentRouteMatch($request_stack);
-
- $route_match = $current_route_match->getRouteMatchFromRequest($request);
- $this->assertEquals('test_route', $route_match->getRouteName());
- $this->assertEquals($route, $route_match->getRouteObject());
- }
-
}
only in patch2:
unchanged:
--- a/core/themes/bartik/bartik.info.yml
+++ b/core/themes/bartik/bartik.info.yml
@@ -16,6 +16,7 @@ regions:
help: Help
page_top: 'Page top'
page_bottom: 'Page bottom'
+ highlighted: Highlighted
featured: Featured
content: Content
sidebar_first: 'Sidebar first'
only in patch2:
unchanged:
--- a/core/themes/bartik/bartik.libraries.yml
+++ b/core/themes/bartik/bartik.libraries.yml
@@ -20,6 +20,7 @@ global-styling:
css/components/forum.css: {}
css/components/header.css: {}
css/components/help.css: {}
+ css/components/highlighted.css: {}
css/components/list.css: {}
css/components/messages.css: {}
css/components/node-preview.css: {}
only in patch2:
unchanged:
--- a/core/themes/bartik/css/components/content.css
+++ b/core/themes/bartik/css/components/content.css
@@ -97,19 +97,6 @@ h1#page-title {
margin-right: 236px;
margin-left: 0;
}
-@media all and (min-width: 560px) {
- .node .field-type-image {
- float: left; /* LTR */
- margin: 0 1em 0 0; /* LTR */
- }
- [dir="rtl"] .node .field-type-image {
- float: right;
- margin: 0 0 0 1em;
- }
- .node .field-type-image + .field-type-image {
- clear: both;
- }
-}
.field-type-image img,
.field-name-field-user-picture img {
margin: 0 0 1em;
only in patch2:
unchanged:
--- /dev/null
+++ b/core/themes/bartik/css/components/highlighted.css
@@ -0,0 +1,6 @@
+/* --------------- Highlighted ---------------- */
+
+#highlighted {
+ border-bottom: 1px solid #d3d7d9;
+ font-size: 120%;
+}
only in patch2:
unchanged:
--- a/core/themes/bartik/templates/page.html.twig
+++ b/core/themes/bartik/templates/page.html.twig
@@ -56,6 +56,7 @@
* - page.primary_menu: Items for the primary menu region.
* - page.secondary_menu: Items for the secondary menu region.
* - page.featured: Items for the featured region.
+ * - page.highlighted: Items for the highlighted content region.
* - page.help: Dynamic help text, mostly for admin pages.
* - page.content: The main content of the current page.
* - page.sidebar_first: Items for the first sidebar.
@@ -128,6 +129,7 @@
{{ breadcrumb }}
+ {% if page.highlighted %}{{ page.highlighted }}
{% endif %}
{{ title_prefix }}
{% if title %}
only in patch2:
unchanged:
--- a/core/themes/seven/css/base/elements.css
+++ b/core/themes/seven/css/base/elements.css
@@ -160,9 +160,3 @@ details summary {
padding-top: 0.5em;
padding-bottom: 0.5em;
}
-details summary:focus {
- border-top: 3px solid #0074bd;
- outline: none;
- color: #0074bd;
- margin-top: -3px;
-}
only in patch2:
unchanged:
--- a/core/themes/seven/css/components/form.css
+++ b/core/themes/seven/css/components/form.css
@@ -24,10 +24,13 @@ fieldset {
}
label {
display: table;
- margin: 0 0 0.1em;
+ margin: 0 0 0 0.2em; /* LTR */
padding: 0;
font-weight: bold;
}
+[dir="rtl"] label {
+ margin: 0 0.2em 0 0;
+}
label.error {
color: #a51b00;
}
only in patch2:
unchanged:
--- a/core/themes/seven/css/components/tour.theme.css
+++ b/core/themes/seven/css/components/tour.theme.css
@@ -42,11 +42,6 @@
border-left-color: transparent;
border-bottom-color: transparent;
}
-.joyride-tip-guide .joyride-nub.top-right {
- border-top-color: transparent;
- border-left-color: transparent;
- border-right-color: transparent;
-}
/* Typography */
.joyride-tip-guide h2 {
@@ -85,11 +80,3 @@
.joyride-modal-bg {
background: rgba(0,0,0, 0.5);
}
-
-.joyride-expose-wrapper {
- background-color: #ffffff;
-}
-
-.joyride-expose-cover {
- background: transparent;
-}
only in patch2:
unchanged:
--- a/core/vendor/composer/autoload_classmap.php
+++ b/core/vendor/composer/autoload_classmap.php
@@ -3,7 +3,7 @@
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
-$baseDir = dirname($vendorDir);
+$baseDir = dirname(dirname($vendorDir));
return array(
'File_Iterator' => $vendorDir . '/phpunit/php-file-iterator/File/Iterator.php',
only in patch2:
unchanged:
--- a/core/vendor/composer/autoload_files.php
+++ b/core/vendor/composer/autoload_files.php
@@ -3,9 +3,9 @@
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
-$baseDir = dirname($vendorDir);
+$baseDir = dirname(dirname($vendorDir));
return array(
$vendorDir . '/react/promise/src/functions.php',
- $baseDir . '/lib/Drupal.php',
+ $baseDir . '/core/lib/Drupal.php',
);
only in patch2:
unchanged:
--- a/core/vendor/composer/autoload_namespaces.php
+++ b/core/vendor/composer/autoload_namespaces.php
@@ -3,7 +3,7 @@
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
-$baseDir = dirname($vendorDir);
+$baseDir = dirname(dirname($vendorDir));
return array(
'org\\bovigo\\vfs\\' => array($vendorDir . '/mikey179/vfsStream/src/main/php'),
only in patch2:
unchanged:
--- a/core/vendor/composer/include_paths.php
+++ b/core/vendor/composer/include_paths.php
@@ -3,7 +3,7 @@
// include_paths.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
-$baseDir = dirname($vendorDir);
+$baseDir = dirname(dirname($vendorDir));
return array(
$vendorDir . '/phpunit/php-text-template',
only in patch2:
unchanged:
--- a/example.gitignore
+++ b/example.gitignore
@@ -7,10 +7,6 @@
# Because .gitignore can be specific to your site, this file has a different
# name; updating Drupal core will not override your custom .gitignore file.
-# Ignore core and vendor when managing dependencies with Composer.
-# core
-# vendor
-
# Ignore configuration files that may contain sensitive information.
sites/*/settings*.php
sites/*/services*.yml