Core and composer updates

This commit is contained in:
Rob Davies 2017-07-03 16:47:07 +01:00
parent a82634bb98
commit 62cac30480
1118 changed files with 21770 additions and 6306 deletions

1
web/.gitattributes vendored
View file

@ -35,6 +35,7 @@
*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 *.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php *.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 *.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php *.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 *.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 *.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2

252
web/composer.lock generated
View file

@ -880,16 +880,16 @@
}, },
{ {
"name": "drupal/core", "name": "drupal/core",
"version": "8.3.1", "version": "8.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/drupal-composer/drupal-core.git", "url": "https://github.com/drupal/core.git",
"reference": "53326f9503e5e9e406fab22e4fbae6ddb706f7be" "reference": "f34eee7255142ab5416107972ef13d011f11e163"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/drupal-composer/drupal-core/zipball/53326f9503e5e9e406fab22e4fbae6ddb706f7be", "url": "https://api.github.com/repos/drupal/core/zipball/f34eee7255142ab5416107972ef13d011f11e163",
"reference": "53326f9503e5e9e406fab22e4fbae6ddb706f7be", "reference": "f34eee7255142ab5416107972ef13d011f11e163",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -923,6 +923,9 @@
"zendframework/zend-diactoros": "~1.1", "zendframework/zend-diactoros": "~1.1",
"zendframework/zend-feed": "~2.4" "zendframework/zend-feed": "~2.4"
}, },
"conflict": {
"drush/drush": "<8.1.10"
},
"replace": { "replace": {
"drupal/action": "self.version", "drupal/action": "self.version",
"drupal/aggregator": "self.version", "drupal/aggregator": "self.version",
@ -1058,7 +1061,7 @@
"GPL-2.0+" "GPL-2.0+"
], ],
"description": "Drupal is an open source content management platform powering millions of websites and applications.", "description": "Drupal is an open source content management platform powering millions of websites and applications.",
"time": "2017-04-19T16:07:22+00:00" "time": "2017-06-21T18:13:27+00:00"
}, },
{ {
"name": "easyrdf/easyrdf", "name": "easyrdf/easyrdf",
@ -1225,16 +1228,16 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "6.2.3", "version": "6.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
"reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1244,9 +1247,12 @@
}, },
"require-dev": { "require-dev": {
"ext-curl": "*", "ext-curl": "*",
"phpunit/phpunit": "^4.0", "phpunit/phpunit": "^4.0 || ^5.0",
"psr/log": "^1.0" "psr/log": "^1.0"
}, },
"suggest": {
"psr/log": "Required for using the Log middleware"
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -1283,7 +1289,7 @@
"rest", "rest",
"web service" "web service"
], ],
"time": "2017-02-28T22:50:30+00:00" "time": "2017-06-22T18:50:49+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
@ -2716,16 +2722,16 @@
}, },
{ {
"name": "symfony-cmf/routing", "name": "symfony-cmf/routing",
"version": "1.4.0", "version": "1.4.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony-cmf/Routing.git", "url": "https://github.com/symfony-cmf/routing.git",
"reference": "b93704ca098334f56e9b317932f21a4362e620db" "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/b93704ca098334f56e9b317932f21a4362e620db", "url": "https://api.github.com/repos/symfony-cmf/routing/zipball/fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac",
"reference": "b93704ca098334f56e9b317932f21a4362e620db", "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2771,7 +2777,7 @@
"database", "database",
"routing" "routing"
], ],
"time": "2016-03-31T09:11:39+00:00" "time": "2017-05-09T08:10:41+00:00"
}, },
{ {
"name": "symfony/browser-kit", "name": "symfony/browser-kit",
@ -2832,16 +2838,16 @@
}, },
{ {
"name": "symfony/class-loader", "name": "symfony/class-loader",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/class-loader.git", "url": "https://github.com/symfony/class-loader.git",
"reference": "2c8de07a8a4cc4da9c018ab7a81888b80e762f93" "reference": "48b96f2fa9bf394cb428aced8efb28709ab54cfc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/class-loader/zipball/2c8de07a8a4cc4da9c018ab7a81888b80e762f93", "url": "https://api.github.com/repos/symfony/class-loader/zipball/48b96f2fa9bf394cb428aced8efb28709ab54cfc",
"reference": "2c8de07a8a4cc4da9c018ab7a81888b80e762f93", "reference": "48b96f2fa9bf394cb428aced8efb28709ab54cfc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2881,20 +2887,20 @@
], ],
"description": "Symfony ClassLoader Component", "description": "Symfony ClassLoader Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-02-18T19:13:35+00:00" "time": "2017-06-01T20:52:29+00:00"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "86407ff20855a5eaa2a7219bd815e9c40a88633e" "reference": "3ef6ef64abecd566d551d9e7f6393ac6e93b2462"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/86407ff20855a5eaa2a7219bd815e9c40a88633e", "url": "https://api.github.com/repos/symfony/console/zipball/3ef6ef64abecd566d551d9e7f6393ac6e93b2462",
"reference": "86407ff20855a5eaa2a7219bd815e9c40a88633e", "reference": "3ef6ef64abecd566d551d9e7f6393ac6e93b2462",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2942,7 +2948,7 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-04-03T20:37:06+00:00" "time": "2017-06-02T14:36:56+00:00"
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
@ -2999,16 +3005,16 @@
}, },
{ {
"name": "symfony/debug", "name": "symfony/debug",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/debug.git", "url": "https://github.com/symfony/debug.git",
"reference": "e90099a2958d4833a02d05b504cc06e1c234abcc" "reference": "8470d7701177a88edeb0cec59b44d50ef4477e9b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/e90099a2958d4833a02d05b504cc06e1c234abcc", "url": "https://api.github.com/repos/symfony/debug/zipball/8470d7701177a88edeb0cec59b44d50ef4477e9b",
"reference": "e90099a2958d4833a02d05b504cc06e1c234abcc", "reference": "8470d7701177a88edeb0cec59b44d50ef4477e9b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3052,20 +3058,20 @@
], ],
"description": "Symfony Debug Component", "description": "Symfony Debug Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-02-18T19:13:35+00:00" "time": "2017-06-01T20:52:29+00:00"
}, },
{ {
"name": "symfony/dependency-injection", "name": "symfony/dependency-injection",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/dependency-injection.git", "url": "https://github.com/symfony/dependency-injection.git",
"reference": "14b9d8ae69ac4c74e8f05fee7e0a57039b99c81e" "reference": "b4a4b8f6ae1d69a6b2c0c31623bbc474121ee075"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/14b9d8ae69ac4c74e8f05fee7e0a57039b99c81e", "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/b4a4b8f6ae1d69a6b2c0c31623bbc474121ee075",
"reference": "14b9d8ae69ac4c74e8f05fee7e0a57039b99c81e", "reference": "b4a4b8f6ae1d69a6b2c0c31623bbc474121ee075",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3115,7 +3121,7 @@
], ],
"description": "Symfony DependencyInjection Component", "description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-04-03T22:14:48+00:00" "time": "2017-06-02T14:36:56+00:00"
}, },
{ {
"name": "symfony/dom-crawler", "name": "symfony/dom-crawler",
@ -3175,16 +3181,16 @@
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
"reference": "88b65f0ac25355090e524aba4ceb066025df8bd2" "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/88b65f0ac25355090e524aba4ceb066025df8bd2", "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1377400fd641d7d1935981546aaef780ecd5bf6d",
"reference": "88b65f0ac25355090e524aba4ceb066025df8bd2", "reference": "1377400fd641d7d1935981546aaef780ecd5bf6d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3231,20 +3237,20 @@
], ],
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-04-03T20:37:06+00:00" "time": "2017-06-02T07:47:27+00:00"
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-foundation.git", "url": "https://github.com/symfony/http-foundation.git",
"reference": "0717efd2f2264dbd3d8e1bc69a0418c2fd6295d2" "reference": "de8d8e83b9ec898e14ef8db84cee5919753b2ae5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/0717efd2f2264dbd3d8e1bc69a0418c2fd6295d2", "url": "https://api.github.com/repos/symfony/http-foundation/zipball/de8d8e83b9ec898e14ef8db84cee5919753b2ae5",
"reference": "0717efd2f2264dbd3d8e1bc69a0418c2fd6295d2", "reference": "de8d8e83b9ec898e14ef8db84cee5919753b2ae5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3286,20 +3292,20 @@
], ],
"description": "Symfony HttpFoundation Component", "description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-04-04T15:24:26+00:00" "time": "2017-06-01T20:52:29+00:00"
}, },
{ {
"name": "symfony/http-kernel", "name": "symfony/http-kernel",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-kernel.git", "url": "https://github.com/symfony/http-kernel.git",
"reference": "3256e9e554f02ba2dd49cff253f15df69c36cf40" "reference": "03ca9421948142df8b9d3ffaeb3bfe8ddee02ca4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/3256e9e554f02ba2dd49cff253f15df69c36cf40", "url": "https://api.github.com/repos/symfony/http-kernel/zipball/03ca9421948142df8b9d3ffaeb3bfe8ddee02ca4",
"reference": "3256e9e554f02ba2dd49cff253f15df69c36cf40", "reference": "03ca9421948142df8b9d3ffaeb3bfe8ddee02ca4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3310,7 +3316,8 @@
"symfony/http-foundation": "~2.7.20|~2.8.13|~3.1.6" "symfony/http-foundation": "~2.7.20|~2.8.13|~3.1.6"
}, },
"conflict": { "conflict": {
"symfony/config": "<2.7" "symfony/config": "<2.7",
"twig/twig": "<1.34|<2.4,>=2"
}, },
"require-dev": { "require-dev": {
"symfony/browser-kit": "~2.3|~3.0.0", "symfony/browser-kit": "~2.3|~3.0.0",
@ -3368,20 +3375,20 @@
], ],
"description": "Symfony HttpKernel Component", "description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-04-05T04:04:34+00:00" "time": "2017-06-07T20:12:31+00:00"
}, },
{ {
"name": "symfony/polyfill-apcu", "name": "symfony/polyfill-apcu",
"version": "v1.3.0", "version": "v1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-apcu.git", "url": "https://github.com/symfony/polyfill-apcu.git",
"reference": "5d4474f447403c3348e37b70acc2b95475b7befa" "reference": "2e7965b8cdfbba50d0092d3f6dca97dddec409e2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/5d4474f447403c3348e37b70acc2b95475b7befa", "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/2e7965b8cdfbba50d0092d3f6dca97dddec409e2",
"reference": "5d4474f447403c3348e37b70acc2b95475b7befa", "reference": "2e7965b8cdfbba50d0092d3f6dca97dddec409e2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3390,7 +3397,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.3-dev" "dev-master": "1.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -3421,20 +3428,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2017-06-09T08:25:21+00:00"
}, },
{ {
"name": "symfony/polyfill-iconv", "name": "symfony/polyfill-iconv",
"version": "v1.3.0", "version": "v1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-iconv.git", "url": "https://github.com/symfony/polyfill-iconv.git",
"reference": "cba36f3616d9866b3e52662e88da5c090fac1e97" "reference": "ae1347fa81423b67dbc232c8c111facb367ff8b9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/cba36f3616d9866b3e52662e88da5c090fac1e97", "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/ae1347fa81423b67dbc232c8c111facb367ff8b9",
"reference": "cba36f3616d9866b3e52662e88da5c090fac1e97", "reference": "ae1347fa81423b67dbc232c8c111facb367ff8b9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3446,7 +3453,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.3-dev" "dev-master": "1.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -3480,20 +3487,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2017-06-09T08:25:21+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.3.0", "version": "v1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" "reference": "f29dca382a6485c3cbe6379f0c61230167681937"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937",
"reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", "reference": "f29dca382a6485c3cbe6379f0c61230167681937",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3505,7 +3512,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.3-dev" "dev-master": "1.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -3539,20 +3546,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2017-06-09T14:24:12+00:00"
}, },
{ {
"name": "symfony/polyfill-php54", "name": "symfony/polyfill-php54",
"version": "v1.3.0", "version": "v1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php54.git", "url": "https://github.com/symfony/polyfill-php54.git",
"reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0" "reference": "7dd1a8b9f0442273fdfeb1c4f5eaff6890a82789"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/90e085822963fdcc9d1c5b73deb3d2e5783b16a0", "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/7dd1a8b9f0442273fdfeb1c4f5eaff6890a82789",
"reference": "90e085822963fdcc9d1c5b73deb3d2e5783b16a0", "reference": "7dd1a8b9f0442273fdfeb1c4f5eaff6890a82789",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3561,7 +3568,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.3-dev" "dev-master": "1.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -3597,20 +3604,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2017-06-09T08:25:21+00:00"
}, },
{ {
"name": "symfony/polyfill-php55", "name": "symfony/polyfill-php55",
"version": "v1.3.0", "version": "v1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php55.git", "url": "https://github.com/symfony/polyfill-php55.git",
"reference": "03e3f0350bca2220e3623a0e340eef194405fc67" "reference": "94566239a7720cde0820f15f0cc348ddb51ba51d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/03e3f0350bca2220e3623a0e340eef194405fc67", "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/94566239a7720cde0820f15f0cc348ddb51ba51d",
"reference": "03e3f0350bca2220e3623a0e340eef194405fc67", "reference": "94566239a7720cde0820f15f0cc348ddb51ba51d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3620,7 +3627,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.3-dev" "dev-master": "1.4-dev"
} }
}, },
"autoload": { "autoload": {
@ -3653,20 +3660,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2017-06-09T08:25:21+00:00"
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "41336b20b52f5fd5b42a227e394e673c8071118f" "reference": "d54232f5682fda2f8bbebff7c81b864646867ab9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/41336b20b52f5fd5b42a227e394e673c8071118f", "url": "https://api.github.com/repos/symfony/process/zipball/d54232f5682fda2f8bbebff7c81b864646867ab9",
"reference": "41336b20b52f5fd5b42a227e394e673c8071118f", "reference": "d54232f5682fda2f8bbebff7c81b864646867ab9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3702,7 +3709,7 @@
], ],
"description": "Symfony Process Component", "description": "Symfony Process Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-04T12:20:59+00:00" "time": "2017-05-08T01:19:21+00:00"
}, },
{ {
"name": "symfony/psr-http-message-bridge", "name": "symfony/psr-http-message-bridge",
@ -3766,16 +3773,16 @@
}, },
{ {
"name": "symfony/routing", "name": "symfony/routing",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/routing.git", "url": "https://github.com/symfony/routing.git",
"reference": "d145cd396f702c497cb24b21785ddac90a23fe71" "reference": "d428588038f13a0e5771a2a8ccbc9de46bba9a19"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/d145cd396f702c497cb24b21785ddac90a23fe71", "url": "https://api.github.com/repos/symfony/routing/zipball/d428588038f13a0e5771a2a8ccbc9de46bba9a19",
"reference": "d145cd396f702c497cb24b21785ddac90a23fe71", "reference": "d428588038f13a0e5771a2a8ccbc9de46bba9a19",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3837,20 +3844,20 @@
"uri", "uri",
"url" "url"
], ],
"time": "2017-03-02T15:56:34+00:00" "time": "2017-06-01T20:52:29+00:00"
}, },
{ {
"name": "symfony/serializer", "name": "symfony/serializer",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/serializer.git", "url": "https://github.com/symfony/serializer.git",
"reference": "d1c3d68daee29bbf0b4600745899a7000c215642" "reference": "c6ccf71a899711efa21b0a98150b2c0af08f3cb2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/serializer/zipball/d1c3d68daee29bbf0b4600745899a7000c215642", "url": "https://api.github.com/repos/symfony/serializer/zipball/c6ccf71a899711efa21b0a98150b2c0af08f3cb2",
"reference": "d1c3d68daee29bbf0b4600745899a7000c215642", "reference": "c6ccf71a899711efa21b0a98150b2c0af08f3cb2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3901,20 +3908,20 @@
], ],
"description": "Symfony Serializer Component", "description": "Symfony Serializer Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-21T22:47:17+00:00" "time": "2017-06-01T20:52:29+00:00"
}, },
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation.git", "url": "https://github.com/symfony/translation.git",
"reference": "047e97a64d609778cadfc76e3a09793696bb19f1" "reference": "14db4cc1172a722aaa3b558bfa8eff593b43cd46"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/047e97a64d609778cadfc76e3a09793696bb19f1", "url": "https://api.github.com/repos/symfony/translation/zipball/14db4cc1172a722aaa3b558bfa8eff593b43cd46",
"reference": "047e97a64d609778cadfc76e3a09793696bb19f1", "reference": "14db4cc1172a722aaa3b558bfa8eff593b43cd46",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3965,20 +3972,20 @@
], ],
"description": "Symfony Translation Component", "description": "Symfony Translation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-21T21:39:01+00:00" "time": "2017-06-01T20:52:29+00:00"
}, },
{ {
"name": "symfony/validator", "name": "symfony/validator",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/validator.git", "url": "https://github.com/symfony/validator.git",
"reference": "43f617ee200af4f4dedbb0782c6c689e06994286" "reference": "9f323f762ad21bfb9df7c1afacbdd8addf0f8c50"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/validator/zipball/43f617ee200af4f4dedbb0782c6c689e06994286", "url": "https://api.github.com/repos/symfony/validator/zipball/9f323f762ad21bfb9df7c1afacbdd8addf0f8c50",
"reference": "43f617ee200af4f4dedbb0782c6c689e06994286", "reference": "9f323f762ad21bfb9df7c1afacbdd8addf0f8c50",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4038,20 +4045,20 @@
], ],
"description": "Symfony Validator Component", "description": "Symfony Validator Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-23T16:08:03+00:00" "time": "2017-06-02T14:36:56+00:00"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v2.8.19", "version": "v2.8.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "286d84891690b0e2515874717e49360d1c98a703" "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/286d84891690b0e2515874717e49360d1c98a703", "url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5",
"reference": "286d84891690b0e2515874717e49360d1c98a703", "reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4087,24 +4094,24 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-03-20T09:41:44+00:00" "time": "2017-06-01T20:52:29+00:00"
}, },
{ {
"name": "twig/twig", "name": "twig/twig",
"version": "v1.33.0", "version": "v1.34.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a" "reference": "451c6f4197e113e24c1c85bc3fc8c2d77adeff2e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a", "url": "https://api.github.com/repos/twigphp/Twig/zipball/451c6f4197e113e24c1c85bc3fc8c2d77adeff2e",
"reference": "05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a", "reference": "451c6f4197e113e24c1c85bc3fc8c2d77adeff2e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.2.7" "php": ">=5.3.3"
}, },
"require-dev": { "require-dev": {
"psr/container": "^1.0", "psr/container": "^1.0",
@ -4114,12 +4121,15 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.33-dev" "dev-master": "1.34-dev"
} }
}, },
"autoload": { "autoload": {
"psr-0": { "psr-0": {
"Twig_": "lib/" "Twig_": "lib/"
},
"psr-4": {
"Twig\\": "src/"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -4149,7 +4159,7 @@
"keywords": [ "keywords": [
"templating" "templating"
], ],
"time": "2017-03-22T15:40:09+00:00" "time": "2017-06-07T18:45:17+00:00"
}, },
{ {
"name": "wikimedia/composer-merge-plugin", "name": "wikimedia/composer-merge-plugin",

View file

@ -1,3 +1,7 @@
Drupal 8.3.4, 2017-06-21
------------------------
- Fixed security issues. See SA-CORE-2017-003.
Drupal 8.3.1, 2017-04-19 Drupal 8.3.1, 2017-04-19
------------------------ ------------------------
- Fixed security issues. See SA-CORE-2017-002. - Fixed security issues. See SA-CORE-2017-002.

View file

@ -22,6 +22,8 @@ Drupal 8
(Product Manager) (Product Manager)
- Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch - Nathaniel Catchpole 'catch' https://www.drupal.org/u/catch
(Framework Manager, Release Manager) (Framework Manager, Release Manager)
- Chris McCafferty 'cilefen' https://www.drupal.org/u/cilefen
(Release Manager)
- Jess Myrbo 'xjm' https://www.drupal.org/u/xjm - Jess Myrbo 'xjm' https://www.drupal.org/u/xjm
(Release Manager) (Release Manager)
- Alex Pott 'alexpott' https://www.drupal.org/u/alexpott - Alex Pott 'alexpott' https://www.drupal.org/u/alexpott
@ -34,8 +36,6 @@ Provisional membership:
(Framework Manager - Frontend) (Framework Manager - Frontend)
- Gábor Hojtsy 'Gábor Hojtsy' https://www.drupal.org/u/gábor-hojtsy - Gábor Hojtsy 'Gábor Hojtsy' https://www.drupal.org/u/gábor-hojtsy
(Product Manager) (Product Manager)
- Chris McCafferty 'cilefen' https://www.drupal.org/u/cilefen
(Release Manager)
- Roy Scholten 'yoroy' https://www.drupal.org/u/yoroy - Roy Scholten 'yoroy' https://www.drupal.org/u/yoroy
(Product Manager) (Product Manager)
@ -87,7 +87,6 @@ Base system
- ? - ?
Basic Auth Basic Auth
- Klaus Purer 'klausi' https://www.drupal.org/u/klausi
- Juampy Novillo Requena 'juampy' https://www.drupal.org/u/juampy - Juampy Novillo Requena 'juampy' https://www.drupal.org/u/juampy
Batch API Batch API
@ -255,6 +254,7 @@ Interface Translation (locale)
JavaScript JavaScript
- Théodore Biadala 'nod_' https://www.drupal.org/u/nod_ - Théodore Biadala 'nod_' https://www.drupal.org/u/nod_
- Kay Leung 'droplet' https://www.drupal.org/u/droplet - Kay Leung 'droplet' https://www.drupal.org/u/droplet
- Matthew Grill 'drpal' https://www.drupal.org/u/drpal
Language Language
- Francesco Placella 'plach' https://www.drupal.org/u/plach - Francesco Placella 'plach' https://www.drupal.org/u/plach
@ -297,7 +297,7 @@ Menu UI
- ? - ?
Node Node
- ? - Tim Millwood 'timmillwood' https://www.drupal.org/u/timmillwood
Node Access Node Access
- Ken Rickard 'agentrickard' https://www.drupal.org/u/agentrickard - Ken Rickard 'agentrickard' https://www.drupal.org/u/agentrickard
@ -340,7 +340,6 @@ Request Processing
- Larry Garfield 'Crell' https://www.drupal.org/u/crell - Larry Garfield 'Crell' https://www.drupal.org/u/crell
REST REST
- Klaus Purer 'klausi' https://www.drupal.org/u/klausi
- Larry Garfield 'Crell' https://www.drupal.org/u/crell - Larry Garfield 'Crell' https://www.drupal.org/u/crell
- Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers - Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
@ -376,7 +375,7 @@ Statistics
- Tim Millwood 'timmillwood' https://www.drupal.org/u/timmillwood - Tim Millwood 'timmillwood' https://www.drupal.org/u/timmillwood
Syslog Syslog
- ? - Mariano D'Agostino 'dagmar' https://www.drupal.org/u/dagmar
System (module) System (module)
- ? - ?
@ -391,7 +390,6 @@ Telephone
Testing framework Testing framework
- Alex Pott 'alexpott' https://www.drupal.org/u/alexpott - Alex Pott 'alexpott' https://www.drupal.org/u/alexpott
- Sascha Grossenbacher 'Berdir' https://www.drupal.org/u/berdir - Sascha Grossenbacher 'Berdir' https://www.drupal.org/u/berdir
- Klaus Purer 'klausi' https://www.drupal.org/u/klausi
- Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner - Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner
Text Field Text Field
@ -477,19 +475,28 @@ re-architect or otherwise improve large areas of Drupal core. See
https://www.drupal.org/community-initiatives/drupal-core for more information on https://www.drupal.org/community-initiatives/drupal-core for more information on
their responsibilities. The initiative coordinators for Drupal 8 are: their responsibilities. The initiative coordinators for Drupal 8 are:
Workflow Initiative API-first Initiative
- Dick Olsson 'dixon_' https://www.drupal.org/u/dixon_ - Wim Leers 'Wim Leers' https://www.drupal.org/u/wim-leers
- Mateu Aguiló Bosch 'e0ipso' https://www.drupal.org/u/e0ipso
PHPUnit Initiative
- Klaus Purer 'klausi' https://www.drupal.org/u/klausi
- Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner
Layout Initiative Layout Initiative
- Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett - Tim Plunkett 'tim.plunkett' https://www.drupal.org/u/tim.plunkett
- Emilie Nouveau 'DyanneNova' https://www.drupal.org/u/dyannenova
Media Initiative Media Initiative
- Janez Urevc 'slashrsm' https://www.drupal.org/u/slashrsm - Janez Urevc 'slashrsm' https://www.drupal.org/u/slashrsm
PHPUnit Initiative
- Daniel Wehner 'dawehner' https://www.drupal.org/u/dawehner
Provisional membership:
- Len Swaneveld 'Lendude' https://www.drupal.org/u/lendude
- Michiel Nugter 'michielnugter' https://www.drupal.org/u/michielnugter
Workflow Initiative
- Dick Olsson 'dixon_' https://www.drupal.org/u/dixon_
Provisional membership: None at this time. Provisional membership: None at this time.

View file

@ -34,6 +34,9 @@
"paragonie/random_compat": "^1.0|^2.0", "paragonie/random_compat": "^1.0|^2.0",
"asm89/stack-cors": "~1.0" "asm89/stack-cors": "~1.0"
}, },
"conflict": {
"drush/drush": "<8.1.10"
},
"require-dev": { "require-dev": {
"behat/mink": "1.7.x-dev", "behat/mink": "1.7.x-dev",
"behat/mink-goutte-driver": "~1.2", "behat/mink-goutte-driver": "~1.2",
@ -172,8 +175,7 @@
"scripts": { "scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump", "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": [ "post-autoload-dump": [
"Drupal\\Core\\Composer\\Composer::ensureHtaccess", "Drupal\\Core\\Composer\\Composer::ensureHtaccess"
"Drupal\\Core\\Composer\\Composer::configurePhpcs"
] ]
} }
} }

View file

@ -79,6 +79,9 @@ create-form:
current: current:
description: "Refers to a resource containing the most recent item(s) in a collection of resources." description: "Refers to a resource containing the most recent item(s) in a collection of resources."
reference: '[RFC5005]' reference: '[RFC5005]'
customize-form:
description: "The target URI points to a resource where a submission form for customizing associated resource can be obtained."
reference: '[RFC6861]'
derivedfrom: derivedfrom:
description: 'The target IRI points to a resource from which this material was derived.' description: 'The target IRI points to a resource from which this material was derived.'
reference: '[draft-hoffman-xml2rfc]' reference: '[draft-hoffman-xml2rfc]'

View file

@ -731,7 +731,7 @@ services:
class: Asm89\Stack\Cors class: Asm89\Stack\Cors
arguments: ['%cors.config%'] arguments: ['%cors.config%']
tags: tags:
- { name: http_middleware } - { name: http_middleware, priority: 250 }
psr7.http_foundation_factory: psr7.http_foundation_factory:
class: Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory class: Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory
psr7.http_message_factory: psr7.http_message_factory:

View file

@ -59,6 +59,8 @@ const ERROR_REPORTING_DISPLAY_VERBOSE = 'verbose';
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
* Use Drupal\Core\Session\AccountInterface::ANONYMOUS_ROLE or * Use Drupal\Core\Session\AccountInterface::ANONYMOUS_ROLE or
* \Drupal\user\RoleInterface::ANONYMOUS_ID instead. * \Drupal\user\RoleInterface::ANONYMOUS_ID instead.
*
* @see https://www.drupal.org/node/1619504
*/ */
const DRUPAL_ANONYMOUS_RID = AccountInterface::ANONYMOUS_ROLE; const DRUPAL_ANONYMOUS_RID = AccountInterface::ANONYMOUS_ROLE;
@ -68,6 +70,8 @@ const DRUPAL_ANONYMOUS_RID = AccountInterface::ANONYMOUS_ROLE;
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
* Use Drupal\Core\Session\AccountInterface::AUTHENTICATED_ROLE or * Use Drupal\Core\Session\AccountInterface::AUTHENTICATED_ROLE or
* \Drupal\user\RoleInterface::AUTHENTICATED_ID instead. * \Drupal\user\RoleInterface::AUTHENTICATED_ID instead.
*
* @see https://www.drupal.org/node/1619504
*/ */
const DRUPAL_AUTHENTICATED_RID = AccountInterface::AUTHENTICATED_ROLE; const DRUPAL_AUTHENTICATED_RID = AccountInterface::AUTHENTICATED_ROLE;
@ -88,6 +92,8 @@ const DRUPAL_EXTENSION_NAME_MAX_LENGTH = 50;
* *
* @deprecated in Drupal 8.3.0, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.3.0, will be removed before Drupal 9.0.0.
* Use \Drupal::time()->getRequestTime(); * Use \Drupal::time()->getRequestTime();
*
* @see https://www.drupal.org/node/2785211
*/ */
define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']); define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']);
@ -105,6 +111,8 @@ const DRUPAL_PHP_FUNCTION_PATTERN = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
* *
* @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Drupal core no * @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Drupal core no
* longer creates an active directory. * longer creates an active directory.
*
* @see https://www.drupal.org/node/2501187
*/ */
const CONFIG_ACTIVE_DIRECTORY = 'active'; const CONFIG_ACTIVE_DIRECTORY = 'active';
@ -123,6 +131,8 @@ const CONFIG_SYNC_DIRECTORY = 'sync';
* *
* @deprecated in Drupal 8.0.x and will be removed before 9.0.0. The staging * @deprecated in Drupal 8.0.x and will be removed before 9.0.0. The staging
* directory was renamed to sync. * directory was renamed to sync.
*
* @see https://www.drupal.org/node/2574957
*/ */
const CONFIG_STAGING_DIRECTORY = 'staging'; const CONFIG_STAGING_DIRECTORY = 'staging';
@ -315,6 +325,8 @@ function t($string, array $args = [], array $options = []) {
* *
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
* Use \Drupal\Component\Render\FormattableMarkup. * Use \Drupal\Component\Render\FormattableMarkup.
*
* @see https://www.drupal.org/node/2302363
*/ */
function format_string($string, array $args) { function format_string($string, array $args) {
return SafeMarkup::format($string, $args); return SafeMarkup::format($string, $args);
@ -348,6 +360,8 @@ function format_string($string, array $args) {
* *
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
* Use \Drupal\Component\Utility\Unicode::validateUtf8(). * Use \Drupal\Component\Utility\Unicode::validateUtf8().
*
* @see https://www.drupal.org/node/1992584
*/ */
function drupal_validate_utf8($text) { function drupal_validate_utf8($text) {
return Unicode::validateUtf8($text); return Unicode::validateUtf8($text);
@ -742,6 +756,8 @@ function drupal_installation_attempted() {
* need to access the value before container is available you can use * need to access the value before container is available you can use
* BootstrapConfigStorageFactory to load the value directly from * BootstrapConfigStorageFactory to load the value directly from
* configuration. * configuration.
*
* @see https://www.drupal.org/node/2538996
*/ */
function drupal_get_profile() { function drupal_get_profile() {
global $install_state; global $install_state;
@ -952,7 +968,7 @@ function drupal_static_reset($name = NULL) {
* string and therefore has few valid use-cases. Note also, that this method * string and therefore has few valid use-cases. Note also, that this method
* does not mark the string as safe. * does not mark the string as safe.
* *
* @see \Drupal\Component\Utility\SafeMarkup::format() * @see https://www.drupal.org/node/2302363
*/ */
function drupal_placeholder($text) { function drupal_placeholder($text) {
return '<em class="placeholder">' . Html::escape($text) . '</em>'; return '<em class="placeholder">' . Html::escape($text) . '</em>';

View file

@ -20,6 +20,8 @@ use Drupal\Core\StreamWrapper\PrivateStream;
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::CHMOD_DIRECTORY. * Use \Drupal\Core\File\FileSystem::CHMOD_DIRECTORY.
*
* @see https://www.drupal.org/node/2418133
*/ */
const FILE_CHMOD_DIRECTORY = FileSystem::CHMOD_DIRECTORY; const FILE_CHMOD_DIRECTORY = FileSystem::CHMOD_DIRECTORY;
@ -28,6 +30,8 @@ const FILE_CHMOD_DIRECTORY = FileSystem::CHMOD_DIRECTORY;
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::CHMOD_FILE. * Use \Drupal\Core\File\FileSystem::CHMOD_FILE.
*
* @see https://www.drupal.org/node/2418133
*/ */
const FILE_CHMOD_FILE = FileSystem::CHMOD_FILE; const FILE_CHMOD_FILE = FileSystem::CHMOD_FILE;
@ -77,6 +81,8 @@ const FILE_STATUS_PERMANENT = 1;
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::uriScheme(). * Use \Drupal\Core\File\FileSystem::uriScheme().
*
* @see https://www.drupal.org/node/2418133
*/ */
function file_uri_scheme($uri) { function file_uri_scheme($uri) {
return \Drupal::service('file_system')->uriScheme($uri); return \Drupal::service('file_system')->uriScheme($uri);
@ -87,6 +93,8 @@ function file_uri_scheme($uri) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::validScheme(). * Use \Drupal\Core\File\FileSystem::validScheme().
*
* @see https://www.drupal.org/node/2418133
*/ */
function file_stream_wrapper_valid_scheme($scheme) { function file_stream_wrapper_valid_scheme($scheme) {
return \Drupal::service('file_system')->validScheme($scheme); return \Drupal::service('file_system')->validScheme($scheme);
@ -386,6 +394,8 @@ function file_save_htaccess($directory, $private = TRUE, $force_overwrite = FALS
* *
* @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0.
* Use \Drupal\Component\PhpStorage\FileStorage::htaccessLines(). * Use \Drupal\Component\PhpStorage\FileStorage::htaccessLines().
*
* @see https://www.drupal.org/node/2418133
*/ */
function file_htaccess_lines($private = TRUE) { function file_htaccess_lines($private = TRUE) {
return FileStorage::htaccessLines($private); return FileStorage::htaccessLines($private);
@ -919,6 +929,8 @@ function file_unmanaged_delete_recursive($path, $callback = NULL) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::moveUploadedFile(). * Use \Drupal\Core\File\FileSystem::moveUploadedFile().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_move_uploaded_file($filename, $uri) { function drupal_move_uploaded_file($filename, $uri) {
return \Drupal::service('file_system')->moveUploadedFile($filename, $uri); return \Drupal::service('file_system')->moveUploadedFile($filename, $uri);
@ -1103,6 +1115,8 @@ function file_upload_max_size() {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::chmod(). * Use \Drupal\Core\File\FileSystem::chmod().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_chmod($uri, $mode = NULL) { function drupal_chmod($uri, $mode = NULL) {
return \Drupal::service('file_system')->chmod($uri, $mode); return \Drupal::service('file_system')->chmod($uri, $mode);
@ -1113,6 +1127,8 @@ function drupal_chmod($uri, $mode = NULL) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::unlink(). * Use \Drupal\Core\File\FileSystem::unlink().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_unlink($uri, $context = NULL) { function drupal_unlink($uri, $context = NULL) {
return \Drupal::service('file_system')->unlink($uri, $context); return \Drupal::service('file_system')->unlink($uri, $context);
@ -1123,6 +1139,8 @@ function drupal_unlink($uri, $context = NULL) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::realpath(). * Use \Drupal\Core\File\FileSystem::realpath().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_realpath($uri) { function drupal_realpath($uri) {
return \Drupal::service('file_system')->realpath($uri); return \Drupal::service('file_system')->realpath($uri);
@ -1133,6 +1151,8 @@ function drupal_realpath($uri) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::dirname(). * Use \Drupal\Core\File\FileSystem::dirname().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_dirname($uri) { function drupal_dirname($uri) {
return \Drupal::service('file_system')->dirname($uri); return \Drupal::service('file_system')->dirname($uri);
@ -1143,6 +1163,8 @@ function drupal_dirname($uri) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::basename(). * Use \Drupal\Core\File\FileSystem::basename().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_basename($uri, $suffix = NULL) { function drupal_basename($uri, $suffix = NULL) {
return \Drupal::service('file_system')->basename($uri, $suffix); return \Drupal::service('file_system')->basename($uri, $suffix);
@ -1154,6 +1176,8 @@ function drupal_basename($uri, $suffix = NULL) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::mkdir(). * Use \Drupal\Core\File\FileSystem::mkdir().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) { function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
return \Drupal::service('file_system')->mkdir($uri, $mode, $recursive, $context); return \Drupal::service('file_system')->mkdir($uri, $mode, $recursive, $context);
@ -1164,6 +1188,8 @@ function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::rmdir(). * Use \Drupal\Core\File\FileSystem::rmdir().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_rmdir($uri, $context = NULL) { function drupal_rmdir($uri, $context = NULL) {
return \Drupal::service('file_system')->rmdir($uri, $context); return \Drupal::service('file_system')->rmdir($uri, $context);
@ -1174,6 +1200,8 @@ function drupal_rmdir($uri, $context = NULL) {
* *
* @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\File\FileSystem::tempnam(). * Use \Drupal\Core\File\FileSystem::tempnam().
*
* @see https://www.drupal.org/node/2418133
*/ */
function drupal_tempnam($directory, $prefix) { function drupal_tempnam($directory, $prefix) {
return \Drupal::service('file_system')->tempnam($directory, $prefix); return \Drupal::service('file_system')->tempnam($directory, $prefix);
@ -1218,6 +1246,8 @@ function file_directory_temp() {
* *
* @deprecated in Drupal 8.3.x-dev, will be removed before Drupal 9.0.0. * @deprecated in Drupal 8.3.x-dev, will be removed before Drupal 9.0.0.
* Use \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory(). * Use \Drupal\Component\FileSystem\FileSystem::getOsTemporaryDirectory().
*
* @see https://www.drupal.org/node/2418133
*/ */
function file_directory_os_temp() { function file_directory_os_temp() {
return ComponentFileSystem::getOsTemporaryDirectory(); return ComponentFileSystem::getOsTemporaryDirectory();

View file

@ -81,7 +81,7 @@ class Drupal {
/** /**
* The current system version. * The current system version.
*/ */
const VERSION = '8.3.1'; const VERSION = '8.3.4';
/** /**
* Core API compatibility. * Core API compatibility.

View file

@ -3,7 +3,9 @@
namespace Drupal\Component\Plugin\Context; namespace Drupal\Component\Plugin\Context;
/** /**
* Interface for context definitions. * Interface used to define definition objects found in ContextInterface.
*
* @see \Drupal\Component\Plugin\Context\ContextInterface
* *
* @todo WARNING: This interface is going to receive some additions as part of * @todo WARNING: This interface is going to receive some additions as part of
* https://www.drupal.org/node/2346999. * https://www.drupal.org/node/2346999.

View file

@ -3,7 +3,14 @@
namespace Drupal\Component\Plugin\Context; namespace Drupal\Component\Plugin\Context;
/** /**
* A generic context interface for wrapping data a plugin needs to operate. * Provides data and definitions for plugins during runtime and administration.
*
* Plugin contexts are satisfied by ContextInterface implementing objects.
* These objects always contain a definition of what data they will provide
* during runtime. During run time, ContextInterface implementing objects must
* also provide the corresponding data value.
*
* @see \Drupal\Component\Plugin\Context\ContextDefinitionInterface
*/ */
interface ContextInterface { interface ContextInterface {

View file

@ -27,6 +27,12 @@ class YamlPecl implements SerializationInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function decode($raw) { public static function decode($raw) {
static $init;
if (!isset($init)) {
// We never want to unserialize !php/object.
ini_set('yaml.decode_php', 0);
$init = TRUE;
}
// yaml_parse() will error with an empty value. // yaml_parse() will error with an empty value.
if (!trim($raw)) { if (!trim($raw)) {
return NULL; return NULL;

View file

@ -61,13 +61,15 @@ class Html {
* Do not pass one string containing multiple classes as they will be * Do not pass one string containing multiple classes as they will be
* incorrectly concatenated with dashes, i.e. "one two" will become "one-two". * incorrectly concatenated with dashes, i.e. "one two" will become "one-two".
* *
* @param string $class * @param mixed $class
* The class name to clean. * The class name to clean. It can be a string or anything that can be cast
* to string.
* *
* @return string * @return string
* The cleaned class name. * The cleaned class name.
*/ */
public static function getClass($class) { public static function getClass($class) {
$class = (string) $class;
if (!isset(static::$classes[$class])) { if (!isset(static::$classes[$class])) {
static::$classes[$class] = static::cleanCssIdentifier(Unicode::strtolower($class)); static::$classes[$class] = static::cleanCssIdentifier(Unicode::strtolower($class));
} }

View file

@ -46,7 +46,7 @@ class UrlHelper {
$params = []; $params = [];
foreach ($query as $key => $value) { foreach ($query as $key => $value) {
$key = ($parent ? $parent . '[' . rawurlencode($key) . ']' : rawurlencode($key)); $key = ($parent ? $parent . rawurlencode('[' . $key . ']') : rawurlencode($key));
// Recurse into children. // Recurse into children.
if (is_array($value)) { if (is_array($value)) {
@ -142,7 +142,12 @@ class UrlHelper {
// External URLs: not using parse_url() here, so we do not have to rebuild // External URLs: not using parse_url() here, so we do not have to rebuild
// the scheme, host, and path without having any use for it. // the scheme, host, and path without having any use for it.
if (strpos($url, '://') !== FALSE) { // The URL is considered external if it contains the '://' delimiter. Since
// a URL can also be passed as a query argument, we check if this delimiter
// appears in front of the '?' query argument delimiter.
$scheme_delimiter_position = strpos($url, '://');
$query_delimiter_position = strpos($url, '?');
if ($scheme_delimiter_position !== FALSE && ($query_delimiter_position === FALSE || $scheme_delimiter_position < $query_delimiter_position)) {
// Split off everything before the query string into 'path'. // Split off everything before the query string into 'path'.
$parts = explode('?', $url); $parts = explode('?', $url);

View file

@ -18,8 +18,6 @@ use Drupal\Core\StringTranslation\TranslatableMarkup;
* "node" = @ContextDefinition("entity:node") * "node" = @ContextDefinition("entity:node")
* } * }
* @endcode * @endcode
* Remove spaces after @ in your actual plugin - these are put into this sample
* code so that it is not recognized as an annotation.
* *
* To add a label to a context definition use the "label" key: * To add a label to a context definition use the "label" key:
* @code * @code

View file

@ -6,6 +6,8 @@ use Symfony\Component\DependencyInjection\ContainerAwareTrait;
/** /**
* Defines the chained fast cache backend factory. * Defines the chained fast cache backend factory.
*
* @see \Drupal\Core\Cache\ChainedFastBackend
*/ */
class ChainedFastBackendFactory implements CacheFactoryInterface { class ChainedFastBackendFactory implements CacheFactoryInterface {

View file

@ -6,7 +6,6 @@ use Drupal\Component\PhpStorage\FileStorage;
use Composer\Script\Event; use Composer\Script\Event;
use Composer\Installer\PackageEvent; use Composer\Installer\PackageEvent;
use Composer\Semver\Constraint\Constraint; use Composer\Semver\Constraint\Constraint;
use PHP_CodeSniffer;
/** /**
* Provides static functions for composer script events. * Provides static functions for composer script events.
@ -137,28 +136,6 @@ EOT;
} }
} }
/**
* Configures phpcs if present.
*
* @param \Composer\Script\Event $event
*/
public static function configurePhpcs(Event $event) {
// Grab the local repo which tells us what's been installed.
$local_repository = $event->getComposer()
->getRepositoryManager()
->getLocalRepository();
// Make sure both phpcs and coder are installed.
$phpcs_package = $local_repository->findPackage('squizlabs/php_codesniffer', '*');
$coder_package = $local_repository->findPackage('drupal/coder', '*');
if (!empty($phpcs_package) && !empty($coder_package)) {
$config = $event->getComposer()->getConfig();
$vendor_dir = $config->get('vendor-dir');
// Set phpcs' installed_paths config to point to our coder_sniffer
// directory.
PHP_CodeSniffer::setConfigData('installed_paths', $vendor_dir . '/drupal/coder/coder_sniffer');
}
}
/** /**
* Remove possibly problematic test files from vendored projects. * Remove possibly problematic test files from vendored projects.
* *

View file

@ -466,7 +466,7 @@ class ConfigInstaller implements ConfigInstallerInterface {
// Check the dependencies of configuration provided by the module. // Check the dependencies of configuration provided by the module.
list($invalid_default_config, $missing_dependencies) = $this->findDefaultConfigWithUnmetDependencies($storage, $enabled_extensions, $profile_storages); list($invalid_default_config, $missing_dependencies) = $this->findDefaultConfigWithUnmetDependencies($storage, $enabled_extensions, $profile_storages);
if (!empty($invalid_default_config)) { if (!empty($invalid_default_config)) {
throw UnmetDependenciesException::create($name, array_unique($missing_dependencies)); throw UnmetDependenciesException::create($name, array_unique($missing_dependencies, SORT_REGULAR));
} }
// Install profiles can not have config clashes. Configuration that // Install profiles can not have config clashes. Configuration that

View file

@ -19,8 +19,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* difficult to unit test. Therefore this base class should only be used by * difficult to unit test. Therefore this base class should only be used by
* controller classes that contain only trivial glue code. Controllers that * controller classes that contain only trivial glue code. Controllers that
* contain sufficiently complex logic that it's worth testing should not use * contain sufficiently complex logic that it's worth testing should not use
* this base class but use ContainerInjectionInterface instead, or even better be * this base class but use ContainerInjectionInterface instead, or even
* refactored to be trivial glue code. * better be refactored to be trivial glue code.
* *
* The services exposed here are those that it is reasonable for a well-behaved * The services exposed here are those that it is reasonable for a well-behaved
* controller to leverage. A controller that needs other services may * controller to leverage. A controller that needs other services may
@ -70,7 +70,7 @@ abstract class ControllerBase implements ContainerInjectionInterface {
/** /**
* The configuration factory. * The configuration factory.
* *
* @var \Drupal\Core\Config\Config * @var \Drupal\Core\Config\ConfigFactoryInterface
*/ */
protected $configFactory; protected $configFactory;

View file

@ -10,9 +10,9 @@ use Symfony\Component\DependencyInjection\Reference;
* Provides a compiler pass for stacked HTTP kernels. * Provides a compiler pass for stacked HTTP kernels.
* *
* Builds the HTTP kernel by collecting all services tagged 'http_middleware' * Builds the HTTP kernel by collecting all services tagged 'http_middleware'
* and assembling them into a StackedKernel. The middleware with the lowest * and assembling them into a StackedKernel. The middleware with the highest
* priority ends up as the outermost while the highest priority middleware * priority ends up as the outermost while the lowest priority middleware wraps
* wraps the actual HTTP kernel defined by the http_kernel.basic service. * the actual HTTP kernel defined by the http_kernel.basic service.
* *
* The 'http_middleware' service tag additionally accepts a 'responder' * The 'http_middleware' service tag additionally accepts a 'responder'
* parameter. It should be set to TRUE if many or most requests will be handled * parameter. It should be set to TRUE if many or most requests will be handled

View file

@ -870,6 +870,16 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
// If there is no container and no cached container definition, build a new // If there is no container and no cached container definition, build a new
// one from scratch. // one from scratch.
if (!isset($container) && !isset($container_definition)) { if (!isset($container) && !isset($container_definition)) {
// Building the container creates 1000s of objects. Garbage collection of
// these objects is expensive. This appears to be causing random
// segmentation faults in PHP 5.6 due to
// https://bugs.php.net/bug.php?id=72286. Once the container is rebuilt,
// garbage collection is re-enabled.
$disable_gc = version_compare(PHP_VERSION, '7', '<') && gc_enabled();
if ($disable_gc) {
gc_collect_cycles();
gc_disable();
}
$container = $this->compileContainer(); $container = $this->compileContainer();
// Only dump the container if dumping is allowed. This is useful for // Only dump the container if dumping is allowed. This is useful for
@ -879,6 +889,11 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
$dumper = new $this->phpArrayDumperClass($container); $dumper = new $this->phpArrayDumperClass($container);
$container_definition = $dumper->getArray(); $container_definition = $dumper->getArray();
} }
// If garbage collection was disabled prior to rebuilding container,
// re-enable it.
if ($disable_gc) {
gc_enable();
}
} }
// The container was rebuilt successfully. // The container was rebuilt successfully.

View file

@ -830,6 +830,7 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
$translation->translationInitialize = FALSE; $translation->translationInitialize = FALSE;
$translation->typedData = NULL; $translation->typedData = NULL;
$translation->loadedRevisionId = &$this->loadedRevisionId; $translation->loadedRevisionId = &$this->loadedRevisionId;
$translation->isDefaultRevision = &$this->isDefaultRevision;
return $translation; return $translation;
} }
@ -1095,7 +1096,7 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
// Ensure that the following properties are actually cloned by // Ensure that the following properties are actually cloned by
// overwriting the original references with ones pointing to copies of // overwriting the original references with ones pointing to copies of
// them: enforceIsNew, newRevision, loadedRevisionId, fields, entityKeys, // them: enforceIsNew, newRevision, loadedRevisionId, fields, entityKeys,
// translatableEntityKeys and values. // translatableEntityKeys, values and isDefaultRevision.
$enforce_is_new = $this->enforceIsNew; $enforce_is_new = $this->enforceIsNew;
$this->enforceIsNew = &$enforce_is_new; $this->enforceIsNew = &$enforce_is_new;
@ -1117,6 +1118,9 @@ abstract class ContentEntityBase extends Entity implements \IteratorAggregate, C
$values = $this->values; $values = $this->values;
$this->values = &$values; $this->values = &$values;
$default_revision = $this->isDefaultRevision;
$this->isDefaultRevision = &$default_revision;
foreach ($this->fields as $name => $fields_by_langcode) { foreach ($this->fields as $name => $fields_by_langcode) {
$this->fields[$name] = []; $this->fields[$name] = [];
// Untranslatable fields may have multiple references for the same field // Untranslatable fields may have multiple references for the same field

View file

@ -318,8 +318,14 @@ class EntityAutocomplete extends Textfield {
* A string of entity labels separated by commas. * A string of entity labels separated by commas.
*/ */
public static function getEntityLabels(array $entities) { public static function getEntityLabels(array $entities) {
/** @var \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository */
$entity_repository = \Drupal::service('entity.repository');
$entity_labels = []; $entity_labels = [];
foreach ($entities as $entity) { foreach ($entities as $entity) {
// Set the entity in the correct language for display.
$entity = $entity_repository->getTranslationFromContext($entity);
// Use the special view label, since some entities allow the label to be // Use the special view label, since some entities allow the label to be
// viewed, even if the entity is not allowed to be viewed. // viewed, even if the entity is not allowed to be viewed.
$label = ($entity->access('view label')) ? $entity->label() : t('- Restricted access -'); $label = ($entity->access('view label')) ? $entity->label() : t('- Restricted access -');

View file

@ -110,6 +110,7 @@ interface EntityInterface extends AccessibleInterface, CacheableDependencyInterf
* @deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0 * @deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0
* Use \Drupal\Core\Entity\EntityInterface::toUrl() instead. * Use \Drupal\Core\Entity\EntityInterface::toUrl() instead.
* *
* @see https://www.drupal.org/node/2614344
* @see \Drupal\Core\Entity\EntityInterface::toUrl * @see \Drupal\Core\Entity\EntityInterface::toUrl
*/ */
public function urlInfo($rel = 'canonical', array $options = []); public function urlInfo($rel = 'canonical', array $options = []);
@ -167,6 +168,7 @@ interface EntityInterface extends AccessibleInterface, CacheableDependencyInterf
* @deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0 * @deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0
* Please use toUrl() instead. * Please use toUrl() instead.
* *
* @see https://www.drupal.org/node/2614344
* @see \Drupal\Core\Entity\EntityInterface::toUrl * @see \Drupal\Core\Entity\EntityInterface::toUrl
*/ */
public function url($rel = 'canonical', $options = []); public function url($rel = 'canonical', $options = []);
@ -189,6 +191,7 @@ interface EntityInterface extends AccessibleInterface, CacheableDependencyInterf
* @deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0 * @deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0
* Please use toLink() instead. * Please use toLink() instead.
* *
* @see https://www.drupal.org/node/2614344
* @see \Drupal\Core\Entity\EntityInterface::toLink * @see \Drupal\Core\Entity\EntityInterface::toLink
*/ */
public function link($text = NULL, $rel = 'canonical', array $options = []); public function link($text = NULL, $rel = 'canonical', array $options = []);

View file

@ -22,7 +22,9 @@ interface EntityListBuilderInterface {
* sorting the loaded entities. * sorting the loaded entities.
* *
* @return \Drupal\Core\Entity\EntityInterface[] * @return \Drupal\Core\Entity\EntityInterface[]
* An array of entities implementing \Drupal\Core\Entity\EntityInterface. * An array of entities implementing \Drupal\Core\Entity\EntityInterface
* indexed by their IDs. Returns an empty array if no matching entities are
* found.
*/ */
public function load(); public function load();

View file

@ -603,6 +603,13 @@ class SqlContentEntityStorage extends ContentEntityStorageBase implements SqlEnt
$this->database->delete($this->revisionTable) $this->database->delete($this->revisionTable)
->condition($this->revisionKey, $revision->getRevisionId()) ->condition($this->revisionKey, $revision->getRevisionId())
->execute(); ->execute();
if ($this->revisionDataTable) {
$this->database->delete($this->revisionDataTable)
->condition($this->revisionKey, $revision->getRevisionId())
->execute();
}
$this->deleteRevisionFromDedicatedTables($revision); $this->deleteRevisionFromDedicatedTables($revision);
} }

View file

@ -0,0 +1,23 @@
<?php
namespace Drupal\Core\Field;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Provides en entity access control handler for base field override entity.
*/
class BaseFieldOverrideAccessControlHandler extends EntityAccessControlHandler {
/**
* {@inheritdoc}
*/
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
$access = parent::checkAccess($entity, $operation, $account);
return $access->orIf(AccessResult::allowedIfHasPermission($account, 'administer ' . $entity->getTargetEntityTypeId() . ' fields'));
}
}

View file

@ -16,7 +16,8 @@ use Drupal\Core\Field\FieldException;
* id = "base_field_override", * id = "base_field_override",
* label = @Translation("Base field override"), * label = @Translation("Base field override"),
* handlers = { * handlers = {
* "storage" = "Drupal\Core\Field\BaseFieldOverrideStorage" * "storage" = "Drupal\Core\Field\BaseFieldOverrideStorage",
* "access" = "Drupal\Core\Field\BaseFieldOverrideAccessControlHandler",
* }, * },
* config_prefix = "base_field_override", * config_prefix = "base_field_override",
* entity_keys = { * entity_keys = {

View file

@ -104,7 +104,8 @@ abstract class EntityReferenceFormatterBase extends FormatterBase {
// tags on which the access results depend, to ensure users that cannot view // tags on which the access results depend, to ensure users that cannot view
// this field at the moment will gain access once any of those cache tags // this field at the moment will gain access once any of those cache tags
// are invalidated. // are invalidated.
$field_level_access_cacheability->applyTo($elements); $field_level_access_cacheability->merge(CacheableMetadata::createFromRenderArray($elements))
->applyTo($elements);
return $elements; return $elements;
} }

View file

@ -0,0 +1,54 @@
<?php
namespace Drupal\Core\Field\Plugin\migrate\field;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;
/**
* @MigrateField(
* id = "email",
* core = {6,7},
* type_map = {
* "email" = "email"
* }
* )
*/
class Email extends FieldPluginBase {
/**
* {@inheritdoc}
*/
public function getFieldWidgetMap() {
return [
'email_textfield' => 'email_default',
];
}
/**
* {@inheritdoc}
*/
public function getFieldFormatterMap() {
return [
'email_formatter_default' => 'basic_string',
'email_formatter_contact' => 'basic_string',
'email_formatter_plain' => 'basic_string',
'email_formatter_spamspan' => 'basic_string',
];
}
/**
* {@inheritdoc}
*/
public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
$process = [
'plugin' => 'iterator',
'source' => $field_name,
'process' => [
'value' => 'email',
],
];
$migration->setProcessOfProperty($field_name, $process);
}
}

View file

@ -5,7 +5,7 @@ namespace Drupal\Core\Lock;
/** /**
* @defgroup lock Locking mechanisms * @defgroup lock Locking mechanisms
* @{ * @{
* Functions to coordinate long-running operations across requests. * Functions to coordinate long operations across requests.
* *
* In most environments, multiple Drupal page requests (a.k.a. threads or * In most environments, multiple Drupal page requests (a.k.a. threads or
* processes) will execute in parallel. This leads to potential conflicts or * processes) will execute in parallel. This leads to potential conflicts or
@ -15,15 +15,14 @@ namespace Drupal\Core\Lock;
* problems with such code, the cron system uses a locking process to ensure * problems with such code, the cron system uses a locking process to ensure
* that cron is not started again if it is already running. * that cron is not started again if it is already running.
* *
* This is a cooperative, advisory lock system. Any long-running operation * To avoid these types of conflicts, Drupal has a cooperative, advisory lock
* that could potentially be attempted in parallel by multiple requests should * system. Any long-running operation that could potentially be attempted in
* try to acquire a lock before proceeding. By obtaining a lock, one request * parallel by multiple requests should try to acquire a lock before
* notifies any other requests that a specific operation is in progress which * proceeding. By obtaining a lock, one request notifies any other requests that
* must not be executed in parallel. * a specific operation is in progress which must not be executed in parallel.
* *
* To use this API, pick a unique name for the lock. A sensible choice is the * To use this API, pick a unique name for the lock. A sensible choice is the
* name of the function performing the operation. A very simple example use of * name of the function performing the operation. Here is a simple example:
* this API:
* @code * @code
* function mymodule_long_operation() { * function mymodule_long_operation() {
* $lock = \Drupal::lock(); * $lock = \Drupal::lock();
@ -53,6 +52,26 @@ namespace Drupal\Core\Lock;
* $lock->acquire() and $lock->wait() will automatically break (delete) a lock * $lock->acquire() and $lock->wait() will automatically break (delete) a lock
* whose duration has exceeded the timeout specified when it was acquired. * whose duration has exceeded the timeout specified when it was acquired.
* *
* The following limitations in this implementation should be carefully noted:
* - Time: Timestamps are derived from the local system clock of the environment
* the code is executing in. The orderly progression of time from this
* viewpoint can be disrupted by external events such as NTP synchronization
* and operator intervention. Where multiple web servers are involved in
* serving the site, they will have their own independent clocks, introducing
* another source of error in the time keeping process. Timeout values applied
* to locks must therefore be considered approximate, and should not be relied
* upon.
* - Uniqueness: Uniqueness of lock names is not enforced. The impact of the
* use of a common lock name will depend on what processes and resources the
* lock is being used to manage.
* - Sharing: There is limited support for resources shared across sites.
* The locks are stored as rows in the semaphore table and, as such, they
* have the same visibility as the table. If resources managed by a lock are
* shared across sites then the semaphore table must be shared across sites
* as well. This is a binary situation: either all resources are shared and
* the semaphore table is shared or no resources are shared and the semaphore
* table is not shared. Mixed mode operation is not supported.
*
* @} End of "defgroup lock". * @} End of "defgroup lock".
*/ */

View file

@ -53,7 +53,7 @@ interface LocalTaskManagerInterface extends PluginManagerInterface {
public function getTasksBuild($current_route_name, RefinableCacheableDependencyInterface &$cacheability); public function getTasksBuild($current_route_name, RefinableCacheableDependencyInterface &$cacheability);
/** /**
* Collects the local tasks (tabs) for the current route. * Renders the local tasks (tabs) for the given route.
* *
* @param string $route_name * @param string $route_name
* The route for which to make renderable local tasks. * The route for which to make renderable local tasks.

View file

@ -21,6 +21,13 @@ class MenuLinkTree implements MenuLinkTreeInterface {
*/ */
protected $treeStorage; protected $treeStorage;
/**
* The menu link plugin manager.
*
* @var \Drupal\Core\Menu\MenuLinkManagerInterface
*/
protected $menuLinkManager;
/** /**
* The route provider to load routes by name. * The route provider to load routes by name.
* *

View file

@ -282,27 +282,44 @@ class MenuTreeStorage implements MenuTreeStorageInterface {
* depth. * depth.
*/ */
protected function doSave(array $link) { protected function doSave(array $link) {
$original = $this->loadFull($link['id']);
// @todo Should we just return here if the link values match the original
// values completely?
// https://www.drupal.org/node/2302137
$affected_menus = []; $affected_menus = [];
$transaction = $this->connection->startTransaction(); // Get the existing definition if it exists. This does not use
try { // self::loadFull() to avoid the unserialization of fields with 'serialize'
// equal to TRUE as defined in self::schemaDefinition(). The makes $original
// easier to compare with the return value of self::preSave().
$query = $this->connection->select($this->table, $this->options);
$query->fields($this->table);
$query->condition('id', $link['id']);
$original = $this->safeExecuteSelect($query)->fetchAssoc();
if ($original) { if ($original) {
$link['mlid'] = $original['mlid']; $link['mlid'] = $original['mlid'];
$link['has_children'] = $original['has_children']; $link['has_children'] = $original['has_children'];
$affected_menus[$original['menu_name']] = $original['menu_name']; $affected_menus[$original['menu_name']] = $original['menu_name'];
$fields = $this->preSave($link, $original);
// If $link matches the $original data then exit early as there are no
// changes to make. Use array_diff_assoc() to check if they match because:
// - Some of the data types of the values are not the same. The values
// in $original are all strings because they have come from database but
// $fields contains typed values.
// - MenuTreeStorage::preSave() removes the 'mlid' from $fields.
// - The order of the keys in $original and $fields is different.
if (array_diff_assoc($fields, $original) == [] && array_diff_assoc($original, $fields) == ['mlid' => $link['mlid']]) {
return $affected_menus;
} }
else { }
$transaction = $this->connection->startTransaction();
try {
if (!$original) {
// Generate a new mlid. // Generate a new mlid.
$options = ['return' => Database::RETURN_INSERT_ID] + $this->options; $options = ['return' => Database::RETURN_INSERT_ID] + $this->options;
$link['mlid'] = $this->connection->insert($this->table, $options) $link['mlid'] = $this->connection->insert($this->table, $options)
->fields(['id' => $link['id'], 'menu_name' => $link['menu_name']]) ->fields(['id' => $link['id'], 'menu_name' => $link['menu_name']])
->execute(); ->execute();
$fields = $this->preSave($link, []);
} }
$fields = $this->preSave($link, $original);
// We may be moving the link to a new menu. // We may be moving the link to a new menu.
$affected_menus[$fields['menu_name']] = $fields['menu_name']; $affected_menus[$fields['menu_name']] = $fields['menu_name'];
$query = $this->connection->update($this->table, $this->options); $query = $this->connection->update($this->table, $this->options);

View file

@ -5,7 +5,10 @@ namespace Drupal\Core\Plugin\Context;
use Drupal\Component\Plugin\Context\ContextDefinitionInterface as ComponentContextDefinitionInterface; use Drupal\Component\Plugin\Context\ContextDefinitionInterface as ComponentContextDefinitionInterface;
/** /**
* Interface for context definitions. * Interface to define definition objects in ContextInterface via TypedData.
*
* @see \Drupal\Component\Plugin\Context\ContextDefinitionInterface
* @see \Drupal\Core\Plugin\Context\ContextInterface
*/ */
interface ContextDefinitionInterface extends ComponentContextDefinitionInterface { interface ContextDefinitionInterface extends ComponentContextDefinitionInterface {

View file

@ -6,7 +6,10 @@ use Drupal\Component\Plugin\Context\ContextInterface as ComponentContextInterfac
use Drupal\Core\Cache\CacheableDependencyInterface; use Drupal\Core\Cache\CacheableDependencyInterface;
/** /**
* Interface for context. * Context data and definitions for plugins supporting caching and return docs.
*
* @see \Drupal\Component\Plugin\Context\ContextInterface
* @see \Drupal\Core\Plugin\Context\ContextDefinitionInterface
*/ */
interface ContextInterface extends ComponentContextInterface, CacheableDependencyInterface { interface ContextInterface extends ComponentContextInterface, CacheableDependencyInterface {

View file

@ -361,7 +361,7 @@ class DefaultPluginManager extends PluginManagerBase implements PluginManagerInt
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getCacheMaxAge() { public function getCacheMaxAge() {
return CACHE::PERMANENT; return Cache::PERMANENT;
} }
} }

View file

@ -15,7 +15,7 @@ namespace Drupal\Core\Plugin;
interface ObjectWithPluginCollectionInterface { interface ObjectWithPluginCollectionInterface {
/** /**
* Gets the plugin collections used by this entity. * Gets the plugin collections used by this object.
* *
* @return \Drupal\Component\Plugin\LazyPluginCollection[] * @return \Drupal\Component\Plugin\LazyPluginCollection[]
* An array of plugin collections, keyed by the property name they use to * An array of plugin collections, keyed by the property name they use to

View file

@ -73,14 +73,11 @@ class StatusMessages extends RenderElement {
* @see drupal_get_messages() * @see drupal_get_messages()
*/ */
public static function renderMessages($type) { public static function renderMessages($type) {
$render = [];
$messages = drupal_get_messages($type);
if ($messages) {
// Render the messages. // Render the messages.
$render = [ return [
'#theme' => 'status_messages', '#theme' => 'status_messages',
// @todo Improve when https://www.drupal.org/node/2278383 lands. // @todo Improve when https://www.drupal.org/node/2278383 lands.
'#message_list' => $messages, '#message_list' => drupal_get_messages($type),
'#status_headings' => [ '#status_headings' => [
'status' => t('Status message'), 'status' => t('Status message'),
'error' => t('Error message'), 'error' => t('Error message'),
@ -88,7 +85,5 @@ class StatusMessages extends RenderElement {
], ],
]; ];
} }
return $render;
}
} }

View file

@ -225,12 +225,7 @@
* For further information on the Theme and Render APIs, see: * For further information on the Theme and Render APIs, see:
* - https://www.drupal.org/docs/8/theming * - https://www.drupal.org/docs/8/theming
* - https://www.drupal.org/developing/api/8/render * - https://www.drupal.org/developing/api/8/render
* - https://www.drupal.org/node/722174 * - @link themeable Theme system overview @endlink.
* - https://www.drupal.org/node/933976
* - https://www.drupal.org/node/930760
*
* @todo Check these links. Some are for Drupal 7, and might need updates for
* Drupal 8.
* *
* @section arrays Render arrays * @section arrays Render arrays
* The core structure of the Render API is the render array, which is a * The core structure of the Render API is the render array, which is a

View file

@ -0,0 +1,24 @@
<?php
namespace Drupal\Core\Test;
/**
* Object to test that security issues around serialization.
*/
class ObjectSerialization {
/**
* ObjectSerialization constructor.
*/
public function __construct() {
throw new \Exception('This object should never be constructed');
}
/**
* ObjectSerialization deconstructor.
*/
public function __destruct() {
throw new \Exception('This object should never be destructed');
}
}

View file

@ -177,12 +177,8 @@
// Remove the current input. // Remove the current input.
terms.pop(); terms.pop();
// Add the selected item. // Add the selected item.
if (ui.item.value.search(',') > 0) {
terms.push('"' + ui.item.value + '"');
}
else {
terms.push(ui.item.value); terms.push(ui.item.value);
}
event.target.value = terms.join(', '); event.target.value = terms.join(', ');
// Return false to tell jQuery UI that we've filled in the value already. // Return false to tell jQuery UI that we've filled in the value already.
return false; return false;

View file

@ -1162,10 +1162,10 @@
// :even and :odd are reversed because jQuery counts from 0 and // :even and :odd are reversed because jQuery counts from 0 and
// we count from 1, so we're out of sync. // we count from 1, so we're out of sync.
// Match immediate children of the parent element to allow nesting. // Match immediate children of the parent element to allow nesting.
$(this.table).find('> tbody > tr.draggable:visible, > tr.draggable:visible') $(this.table).find('> tbody > tr.draggable, > tr.draggable')
.removeClass('odd even') .filter(':visible')
.filter(':odd').addClass('even').end() .filter(':odd').removeClass('odd').addClass('even').end()
.filter(':even').addClass('odd'); .filter(':even').removeClass('even').addClass('odd');
}; };
/** /**

View file

@ -3,6 +3,7 @@ status: true
dependencies: dependencies:
module: module:
- aggregator - aggregator
- user
id: aggregator_rss_feed id: aggregator_rss_feed
label: 'Aggregator RSS feed' label: 'Aggregator RSS feed'
module: aggregator module: aggregator
@ -137,6 +138,8 @@ display:
- url.query_args - url.query_args
- user.permissions - user.permissions
cacheable: false cacheable: false
max-age: -1
tags: { }
feed_items: feed_items:
display_plugin: feed display_plugin: feed
id: feed_items id: feed_items
@ -154,3 +157,5 @@ display:
- 'languages:language_interface' - 'languages:language_interface'
- user.permissions - user.permissions
cacheable: false cacheable: false
max-age: -1
tags: { }

View file

@ -143,7 +143,8 @@ display:
- 'languages:language_interface' - 'languages:language_interface'
- url.query_args - url.query_args
- user.permissions - user.permissions
max-age: 0 max-age: -1
tags: { }
feed_1: feed_1:
display_plugin: feed display_plugin: feed
id: feed_1 id: feed_1
@ -401,7 +402,8 @@ display:
- 'languages:language_content' - 'languages:language_content'
- 'languages:language_interface' - 'languages:language_interface'
- user.permissions - user.permissions
max-age: 0 max-age: -1
tags: { }
page_1: page_1:
display_plugin: page display_plugin: page
id: page_1 id: page_1
@ -423,4 +425,5 @@ display:
- 'languages:language_interface' - 'languages:language_interface'
- url.query_args - url.query_args
- user.permissions - user.permissions
max-age: 0 max-age: -1
tags: { }

View file

@ -7,7 +7,7 @@ source:
process: process:
iid: iid iid: iid
fid: fid:
plugin: migration plugin: migration_lookup
migration: d6_aggregator_feed migration: d6_aggregator_feed
source: fid source: fid
title: title title: title

View file

@ -7,7 +7,7 @@ source:
process: process:
iid: iid iid: iid
fid: fid:
plugin: migration plugin: migration_lookup
migration: d7_aggregator_feed migration: d7_aggregator_feed
source: fid source: fid
title: title title: title

View file

@ -60,4 +60,14 @@ class FeedAdminDisplayTest extends AggregatorTestBase {
$this->assertNoText('left', 'The feed is not scheduled. It does not show a timeframe "x x left" for next update.'); $this->assertNoText('left', 'The feed is not scheduled. It does not show a timeframe "x x left" for next update.');
} }
/**
* {@inheritdoc}
*/
public function randomMachineName($length = 8) {
$value = parent::randomMachineName($length);
// See expected values in testFeedUpdateFields().
$value = str_replace(['never', 'imminently', 'ago', 'left'], 'x', $value);
return $value;
}
} }

View file

@ -59,29 +59,29 @@ class BigPipePlaceholderTestCases {
], ],
] ]
); );
$status_messages->bigPipePlaceholderId = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args[0]&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA'; $status_messages->bigPipePlaceholderId = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args%5B0%5D&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA';
$status_messages->bigPipePlaceholderRenderArray = [ $status_messages->bigPipePlaceholderRenderArray = [
'#markup' => '<span data-big-pipe-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args[0]&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"></span>', '#markup' => '<span data-big-pipe-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args%5B0%5D&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"></span>',
'#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#cache' => $cacheability_depends_on_session_and_nojs_cookie,
'#attached' => [ '#attached' => [
'library' => ['big_pipe/big_pipe'], 'library' => ['big_pipe/big_pipe'],
'drupalSettings' => [ 'drupalSettings' => [
'bigPipePlaceholderIds' => [ 'bigPipePlaceholderIds' => [
'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA' => TRUE, 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args%5B0%5D&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA' => TRUE,
], ],
], ],
'big_pipe_placeholders' => [ 'big_pipe_placeholders' => [
'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args[0]&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA' => $status_messages->placeholderRenderArray, 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args%5B0%5D&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA' => $status_messages->placeholderRenderArray,
], ],
], ],
]; ];
$status_messages->bigPipeNoJsPlaceholder = '<span data-big-pipe-nojs-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args[0]&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"></span>'; $status_messages->bigPipeNoJsPlaceholder = '<span data-big-pipe-nojs-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args%5B0%5D&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"></span>';
$status_messages->bigPipeNoJsPlaceholderRenderArray = [ $status_messages->bigPipeNoJsPlaceholderRenderArray = [
'#markup' => '<span data-big-pipe-nojs-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args[0]&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"></span>', '#markup' => '<span data-big-pipe-nojs-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args%5B0%5D&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"></span>',
'#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#cache' => $cacheability_depends_on_session_and_nojs_cookie,
'#attached' => [ '#attached' => [
'big_pipe_nojs_placeholders' => [ 'big_pipe_nojs_placeholders' => [
'<span data-big-pipe-nojs-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args[0]&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"></span>' => $status_messages->placeholderRenderArray, '<span data-big-pipe-nojs-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args%5B0%5D&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"></span>' => $status_messages->placeholderRenderArray,
], ],
], ],
]; ];
@ -109,7 +109,7 @@ class BigPipePlaceholderTestCases {
[ [
'command' => 'insert', 'command' => 'insert',
'method' => 'replaceWith', 'method' => 'replaceWith',
'selector' => '[data-big-pipe-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"]', 'selector' => '[data-big-pipe-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args%5B0%5D&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"]',
'data' => "\n" . ' <div role="contentinfo" aria-label="Status message" class="messages messages--status">' . "\n" . ' <h2 class="visually-hidden">Status message</h2>' . "\n" . ' Hello from BigPipe!' . "\n" . ' </div>' . "\n ", 'data' => "\n" . ' <div role="contentinfo" aria-label="Status message" class="messages messages--status">' . "\n" . ' <h2 class="visually-hidden">Status message</h2>' . "\n" . ' Hello from BigPipe!' . "\n" . ' </div>' . "\n ",
'settings' => NULL, 'settings' => NULL,
], ],
@ -272,24 +272,24 @@ class BigPipePlaceholderTestCases {
'#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::exception', ['llamas', 'suck']], '#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::exception', ['llamas', 'suck']],
] ]
); );
$exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&amp;args[0]=llamas&amp;args[1]=suck&amp;token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU'; $exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&amp;args%5B0%5D=llamas&amp;args%5B1%5D=suck&amp;token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU';
$exception->bigPipePlaceholderRenderArray = [ $exception->bigPipePlaceholderRenderArray = [
'#markup' => '<span data-big-pipe-placeholder-id="callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&amp;args[0]=llamas&amp;args[1]=suck&amp;token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU"></span>', '#markup' => '<span data-big-pipe-placeholder-id="callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&amp;args%5B0%5D=llamas&amp;args%5B1%5D=suck&amp;token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU"></span>',
'#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#cache' => $cacheability_depends_on_session_and_nojs_cookie,
'#attached' => [ '#attached' => [
'library' => ['big_pipe/big_pipe'], 'library' => ['big_pipe/big_pipe'],
'drupalSettings' => [ 'drupalSettings' => [
'bigPipePlaceholderIds' => [ 'bigPipePlaceholderIds' => [
'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args[0]=llamas&args[1]=suck&token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU' => TRUE, 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args%5B0%5D=llamas&args%5B1%5D=suck&token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU' => TRUE,
], ],
], ],
'big_pipe_placeholders' => [ 'big_pipe_placeholders' => [
'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&amp;args[0]=llamas&amp;args[1]=suck&amp;token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU' => $exception->placeholderRenderArray, 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&amp;args%5B0%5D=llamas&amp;args%5B1%5D=suck&amp;token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU' => $exception->placeholderRenderArray,
], ],
], ],
]; ];
$exception->embeddedAjaxResponseCommands = NULL; $exception->embeddedAjaxResponseCommands = NULL;
$exception->bigPipeNoJsPlaceholder = '<span data-big-pipe-nojs-placeholder-id="callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&amp;args[0]=llamas&amp;args[1]=suck&amp;token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU"></span>'; $exception->bigPipeNoJsPlaceholder = '<span data-big-pipe-nojs-placeholder-id="callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&amp;args%5B0%5D=llamas&amp;args%5B1%5D=suck&amp;token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU"></span>';
$exception->bigPipeNoJsPlaceholderRenderArray = [ $exception->bigPipeNoJsPlaceholderRenderArray = [
'#markup' => $exception->bigPipeNoJsPlaceholder, '#markup' => $exception->bigPipeNoJsPlaceholder,
'#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#cache' => $cacheability_depends_on_session_and_nojs_cookie,

View file

@ -293,7 +293,7 @@ class BigPipeTest extends WebTestBase {
// @see performMetaRefresh() // @see performMetaRefresh()
$this->drupalGet(Url::fromRoute('big_pipe_test_multi_occurrence')); $this->drupalGet(Url::fromRoute('big_pipe_test_multi_occurrence'));
$big_pipe_placeholder_id = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args[0]&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA'; $big_pipe_placeholder_id = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&amp;args%5B0%5D&amp;token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA';
$expected_placeholder_replacement = '<script type="application/vnd.drupal-ajax" data-big-pipe-replacement-for-placeholder-with-id="' . $big_pipe_placeholder_id . '">'; $expected_placeholder_replacement = '<script type="application/vnd.drupal-ajax" data-big-pipe-replacement-for-placeholder-with-id="' . $big_pipe_placeholder_id . '">';
$this->assertRaw('The count is 1.'); $this->assertRaw('The count is 1.');
$this->assertNoRaw('The count is 2.'); $this->assertNoRaw('The count is 2.');

View file

@ -13,7 +13,8 @@ process:
source: status source: status
id: id:
# We need something unique, so aggregator, aggregator_1 etc will do. # We need something unique, so aggregator, aggregator_1 etc will do.
plugin: dedupe_entity plugin: make_unique_entity_field
entity_type: block entity_type: block
field: id field: id
postfix: _ postfix: _

View file

@ -21,6 +21,12 @@ class MigrateBlockTest extends MigrateDrupal6TestBase {
'comment', 'comment',
'menu_ui', 'menu_ui',
'block_content', 'block_content',
'taxonomy',
'node',
'aggregator',
'book',
'forum',
'statistics',
]; ];
/** /**
@ -30,15 +36,14 @@ class MigrateBlockTest extends MigrateDrupal6TestBase {
parent::setUp(); parent::setUp();
// Install the themes used for this test. // Install the themes used for this test.
$this->container->get('theme_installer')->install(['bartik', 'seven', 'test_theme']); $this->container->get('theme_installer')->install(['bartik', 'test_theme']);
$this->installConfig(['block_content']); $this->installConfig(['block_content']);
$this->installEntitySchema('block_content'); $this->installEntitySchema('block_content');
// Set Bartik and Seven as the default public and admin theme. // Set Bartik as the default public theme.
$config = $this->config('system.theme'); $config = $this->config('system.theme');
$config->set('default', 'bartik'); $config->set('default', 'bartik');
$config->set('admin', 'seven');
$config->save(); $config->save();
$this->executeMigrations([ $this->executeMigrations([
@ -46,7 +51,6 @@ class MigrateBlockTest extends MigrateDrupal6TestBase {
'block_content_type', 'block_content_type',
'block_content_body_field', 'block_content_body_field',
'd6_custom_block', 'd6_custom_block',
'menu',
'd6_user_role', 'd6_user_role',
'd6_block', 'd6_block',
]); ]);
@ -66,14 +70,12 @@ class MigrateBlockTest extends MigrateDrupal6TestBase {
* The theme. * The theme.
* @param string $weight * @param string $weight
* The block weight. * The block weight.
* @param string $label * @param array $settings
* The block label. * (optional) The block settings.
* @param string $label_display
* The block label display setting.
* @param bool $status * @param bool $status
* Whether the block is expected to be enabled or disabled. * Whether the block is expected to be enabled or disabled.
*/ */
public function assertEntity($id, $visibility, $region, $theme, $weight, $label, $label_display, $status = TRUE) { public function assertEntity($id, $visibility, $region, $theme, $weight, array $settings = NULL, $status = TRUE) {
$block = Block::load($id); $block = Block::load($id);
$this->assertTrue($block instanceof Block); $this->assertTrue($block instanceof Block);
$this->assertSame($visibility, $block->getVisibility()); $this->assertSame($visibility, $block->getVisibility());
@ -81,10 +83,11 @@ class MigrateBlockTest extends MigrateDrupal6TestBase {
$this->assertSame($theme, $block->getTheme()); $this->assertSame($theme, $block->getTheme());
$this->assertSame($weight, $block->getWeight()); $this->assertSame($weight, $block->getWeight());
$this->assertSame($status, $block->status()); $this->assertSame($status, $block->status());
if ($settings) {
$config = $this->config('block.block.' . $id); $block_settings = $block->get('settings');
$this->assertSame($label, $config->get('settings.label')); $block_settings['id'] = current(explode(':', $block_settings['id']));
$this->assertSame($label_display, $config->get('settings.label_display')); $this->assertEquals($settings, $block_settings);
}
} }
/** /**
@ -92,62 +95,209 @@ class MigrateBlockTest extends MigrateDrupal6TestBase {
*/ */
public function testBlockMigration() { public function testBlockMigration() {
$blocks = Block::loadMultiple(); $blocks = Block::loadMultiple();
$this->assertIdentical(9, count($blocks)); $this->assertCount(14, $blocks);
// User blocks // Check user blocks.
$visibility = []; $visibility = [
$visibility['request_path']['id'] = 'request_path'; 'request_path' => [
$visibility['request_path']['negate'] = TRUE; 'id' => 'request_path',
$visibility['request_path']['pages'] = "<front>\n/node/1\n/blog/*"; 'negate' => TRUE,
$this->assertEntity('user', $visibility, 'sidebar_first', 'bartik', 0, '', '0'); 'pages' => "<front>\n/node/1\n/blog/*",
],
$visibility = [];
$this->assertEntity('user_1', $visibility, 'sidebar_first', 'bartik', 0, '', '0');
$visibility['user_role']['id'] = 'user_role';
$roles['authenticated'] = 'authenticated';
$visibility['user_role']['roles'] = $roles;
$context_mapping['user'] = '@user.current_user_context:current_user';
$visibility['user_role']['context_mapping'] = $context_mapping;
$visibility['user_role']['negate'] = FALSE;
$this->assertEntity('user_2', $visibility, 'sidebar_second', 'bartik', -9, '', '0');
$visibility = [];
$visibility['user_role']['id'] = 'user_role';
$visibility['user_role']['roles'] = [
'migrate_test_role_1' => 'migrate_test_role_1'
]; ];
$context_mapping['user'] = '@user.current_user_context:current_user'; $settings = [
$visibility['user_role']['context_mapping'] = $context_mapping; 'id' => 'user_login_block',
$visibility['user_role']['negate'] = FALSE; 'label' => '',
$this->assertEntity('user_3', $visibility, 'sidebar_second', 'bartik', -6, '', '0'); 'provider' => 'user',
'label_display' => '0',
];
$this->assertEntity('user', $visibility, 'sidebar_first', 'bartik', -10, $settings);
// Check system block
$visibility = []; $visibility = [];
$visibility['request_path']['id'] = 'request_path'; $settings = [
$visibility['request_path']['negate'] = TRUE; 'id' => 'system_menu_block',
$visibility['request_path']['pages'] = '/node/1'; 'label' => '',
$this->assertEntity('system', $visibility, 'footer_fifth', 'bartik', -5, '', '0'); 'provider' => 'system',
'label_display' => '0',
'level' => 1,
'depth' => 0,
];
$this->assertEntity('user_1', $visibility, 'sidebar_first', 'bartik', -11, $settings);
// Check menu blocks $visibility = [
$visibility = []; 'user_role' => [
$this->assertEntity('menu', $visibility, 'header', 'bartik', -5, '', '0'); 'id' => 'user_role',
'roles' => [
'authenticated' => 'authenticated',
],
'context_mapping' => [
'user' => '@user.current_user_context:current_user',
],
'negate' => FALSE,
],
];
$settings = [
'id' => 'broken',
'label' => '',
'provider' => 'core',
'label_display' => '0',
'items_per_page' => '5',
];
$this->assertEntity('user_2', $visibility, 'sidebar_second', 'bartik', -11, $settings);
// Check custom blocks $visibility = [
$visibility['request_path']['id'] = 'request_path'; 'user_role' => [
$visibility['request_path']['negate'] = FALSE; 'id' => 'user_role',
$visibility['request_path']['pages'] = '<front>'; 'roles' => [
$this->assertEntity('block', $visibility, 'content', 'bartik', 0, 'Static Block', 'visible'); 'migrate_test_role_1' => 'migrate_test_role_1',
],
'context_mapping' => [
'user' => '@user.current_user_context:current_user',
],
'negate' => FALSE,
],
];
$settings = [
'id' => 'broken',
'label' => '',
'provider' => 'core',
'label_display' => '0',
'items_per_page' => '10',
];
$this->assertEntity('user_3', $visibility, 'sidebar_second', 'bartik', -10, $settings);
$visibility['request_path']['id'] = 'request_path'; // Check system block.
$visibility['request_path']['negate'] = FALSE; $visibility = [
$visibility['request_path']['pages'] = '/node'; 'request_path' => [
'id' => 'request_path',
'negate' => TRUE,
'pages' => '/node/1',
],
];
$settings = [
'id' => 'system_powered_by_block',
'label' => '',
'provider' => 'system',
'label_display' => '0',
];
$this->assertEntity('system', $visibility, 'footer_fifth', 'bartik', -5, $settings);
// Check menu blocks.
$settings = [
'id' => 'broken',
'label' => '',
'provider' => 'core',
'label_display' => '0',
];
$this->assertEntity('menu', [], 'header', 'bartik', -5, $settings);
// Check aggregator block.
$settings = [
'id' => 'aggregator_feed_block',
'label' => '',
'provider' => 'aggregator',
'label_display' => '0',
'block_count' => 7,
'feed' => '5',
];
$this->assertEntity('aggregator', [], 'sidebar_second', 'bartik', -2, $settings);
// Check book block.
$settings = [
'id' => 'book_navigation',
'label' => '',
'provider' => 'book',
'label_display' => '0',
'block_mode' => 'book pages',
];
$this->assertEntity('book', [], 'sidebar_second', 'bartik', -4, $settings);
// Check forum block settings.
$settings = [
'id' => 'forum_active_block',
'label' => '',
'provider' => 'forum',
'label_display' => '0',
'block_count' => 3,
'properties' => [
'administrative' => '1',
],
];
$this->assertEntity('forum', [], 'sidebar_first', 'bartik', -8, $settings);
$settings = [
'id' => 'forum_new_block',
'label' => '',
'provider' => 'forum',
'label_display' => '0',
'block_count' => 4,
'properties' => [
'administrative' => '1',
],
];
$this->assertEntity('forum_1', [], 'sidebar_first', 'bartik', -9, $settings);
// Check statistic block settings.
$settings = [
'id' => 'broken',
'label' => '',
'provider' => 'core',
'label_display' => '0',
'top_day_num' => 7,
'top_all_num' => 8,
'top_last_num' => 9,
];
$this->assertEntity('statistics', [], 'sidebar_second', 'bartik', 0, $settings);
// Check custom blocks.
$visibility = [
'request_path' => [
'id' => 'request_path',
'negate' => FALSE,
'pages' => '<front>',
],
];
$settings = [
'id' => 'block_content',
'label' => 'Static Block',
'provider' => 'block_content',
'label_display' => 'visible',
'status' => TRUE,
'info' => '',
'view_mode' => 'full',
];
$this->assertEntity('block', $visibility, 'content', 'bartik', 0, $settings);
$visibility = [
'request_path' => [
'id' => 'request_path',
'negate' => FALSE,
'pages' => '/node',
],
];
$settings = [
'id' => 'block_content',
'label' => 'Another Static Block',
'provider' => 'block_content',
'label_display' => 'visible',
'status' => TRUE,
'info' => '',
'view_mode' => 'full',
];
// We expect this block to be disabled because '' is not a valid region, // We expect this block to be disabled because '' is not a valid region,
// and block_rebuild() will disable any block in an invalid region. // and block_rebuild() will disable any block in an invalid region.
$this->assertEntity('block_1', $visibility, '', 'bluemarine', -4, 'Another Static Block', 'visible', FALSE); $this->assertEntity('block_1', $visibility, '', 'bluemarine', -4, $settings, FALSE);
$visibility = []; $settings = [
$this->assertEntity('block_2', $visibility, 'right', 'test_theme', -7, '', '0'); 'id' => 'block_content',
'label' => '',
'provider' => 'block_content',
'label_display' => '0',
'status' => TRUE,
'info' => '',
'view_mode' => 'full',
];
$this->assertEntity('block_2', [], 'right', 'test_theme', -7, $settings);
// Custom block with php code is not migrated. // Custom block with php code is not migrated.
$block = Block::load('block_3'); $block = Block::load('block_3');

View file

@ -18,7 +18,7 @@ function block_content_help($route_name, RouteMatchInterface $route_match) {
$field_ui = \Drupal::moduleHandler()->moduleExists('field_ui') ? \Drupal::url('help.page', ['name' => 'field_ui']) : '#'; $field_ui = \Drupal::moduleHandler()->moduleExists('field_ui') ? \Drupal::url('help.page', ['name' => 'field_ui']) : '#';
$output = ''; $output = '';
$output .= '<h3>' . t('About') . '</h3>'; $output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Custom Block module allows you to create and manage custom <em>block types</em> and <em>content-containing blocks</em> from the <a href = ":block-library" >Custom block library<a/> page. Custom block types have fields; see the <a href=":field-help">Field module help</a> for more information. Once created, custom blocks can be placed in regions just like blocks provided by other modules; see the <a href=":blocks">Block module help</a> page for details. For more information, see the <a href=":online-help">online documentation for the Custom Block module</a>.', [':block-library' => \Drupal::url('entity.block_content.collection'), ':block-content' => \Drupal::url('entity.block_content.collection'), ':field-help' => \Drupal::url('help.page', ['name' => 'field']), ':blocks' => \Drupal::url('help.page', ['name' => 'block']), ':online-help' => 'https://www.drupal.org/documentation/modules/block_content']) . '</p>'; $output .= '<p>' . t('The Custom Block module allows you to create and manage custom <em>block types</em> and <em>content-containing blocks</em> from the <a href = ":block-library" >Custom block library</a> page. Custom block types have fields; see the <a href=":field-help">Field module help</a> for more information. Once created, custom blocks can be placed in regions just like blocks provided by other modules; see the <a href=":blocks">Block module help</a> page for details. For more information, see the <a href=":online-help">online documentation for the Custom Block module</a>.', [':block-library' => \Drupal::url('entity.block_content.collection'), ':block-content' => \Drupal::url('entity.block_content.collection'), ':field-help' => \Drupal::url('help.page', ['name' => 'field']), ':blocks' => \Drupal::url('help.page', ['name' => 'block']), ':online-help' => 'https://www.drupal.org/documentation/modules/block_content']) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>'; $output .= '<dl>';
$output .= '<dt>' . t('Creating and managing custom block types') . '</dt>'; $output .= '<dt>' . t('Creating and managing custom block types') . '</dt>';

View file

@ -79,6 +79,7 @@ entity.block_content_type.edit_form:
path: '/admin/structure/block/block-content/manage/{block_content_type}' path: '/admin/structure/block/block-content/manage/{block_content_type}'
defaults: defaults:
_entity_form: 'block_content_type.edit' _entity_form: 'block_content_type.edit'
_title_callback: '\Drupal\Core\Entity\Controller\EntityController::title'
requirements: requirements:
_entity_access: 'block_content_type.update' _entity_access: 'block_content_type.update'

View file

@ -0,0 +1,39 @@
id: block_content_entity_display
label: Body field display configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: embedded_data
data_rows:
-
entity_type: block_content
bundle: basic
view_mode: default
field_name: body
options:
label: hidden
ids:
entity_type:
type: string
bundle:
type: string
view_mode:
type: string
field_name:
type: string
process:
entity_type: entity_type
bundle: bundle
view_mode: view_mode
field_name: field_name
options: options
destination:
plugin: component_entity_display
migration_dependencies:
required:
- block_content_body_field
provider:
- block_content
- migrate_drupal

View file

@ -0,0 +1,36 @@
id: block_content_entity_form_display
label: Body field form display configuration
migration_tags:
- Drupal 6
- Drupal 7
source:
plugin: embedded_data
data_rows:
-
entity_type: block_content
bundle: basic
form_mode: default
field_name: body
ids:
entity_type:
type: string
bundle:
type: string
form_mode:
type: string
field_name:
type: string
process:
entity_type: entity_type
bundle: bundle
form_mode: form_mode
field_name: field_name
destination:
plugin: component_entity_form_display
migration_dependencies:
required:
- block_content_body_field
provider:
- block_content
- migrate_drupal

View file

@ -8,7 +8,7 @@ process:
id: bid id: bid
info: info info: info
'body/format': 'body/format':
plugin: migration plugin: migration_lookup
migration: d6_filter_format migration: d6_filter_format
source: format source: format
'body/value': body 'body/value': body

View file

@ -8,7 +8,7 @@ process:
id: bid id: bid
info: info info: info
'body/format': 'body/format':
plugin: migration plugin: migration_lookup
migration: d7_filter_format migration: d7_filter_format
source: format source: format
'body/value': body 'body/value': body

View file

@ -4,6 +4,8 @@ namespace Drupal\block_content\Tests;
use Drupal\block_content\Entity\BlockContentType; use Drupal\block_content\Entity\BlockContentType;
use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Html;
use Drupal\Core\Url;
use Drupal\system\Tests\Menu\AssertBreadcrumbTrait;
/** /**
* Ensures that custom block type functions work correctly. * Ensures that custom block type functions work correctly.
@ -12,6 +14,7 @@ use Drupal\Component\Utility\Html;
*/ */
class BlockContentTypeTest extends BlockContentTestBase { class BlockContentTypeTest extends BlockContentTestBase {
use AssertBreadcrumbTrait;
/** /**
* Modules to enable. * Modules to enable.
* *
@ -91,6 +94,7 @@ class BlockContentTypeTest extends BlockContentTestBase {
* Tests editing a block type using the UI. * Tests editing a block type using the UI.
*/ */
public function testBlockContentTypeEditing() { public function testBlockContentTypeEditing() {
$this->drupalPlaceBlock('system_breadcrumb_block');
// Now create an initial block-type. // Now create an initial block-type.
$this->createBlockContentType('basic', TRUE); $this->createBlockContentType('basic', TRUE);
@ -113,6 +117,13 @@ class BlockContentTypeTest extends BlockContentTestBase {
$this->drupalGet('admin/structure/block/block-content/manage/basic'); $this->drupalGet('admin/structure/block/block-content/manage/basic');
$this->assertTitle(format_string('Edit @type custom block type | Drupal', ['@type' => 'basic'])); $this->assertTitle(format_string('Edit @type custom block type | Drupal', ['@type' => 'basic']));
$this->drupalPostForm(NULL, $edit, t('Save')); $this->drupalPostForm(NULL, $edit, t('Save'));
$front_page_path = Url::fromRoute('<front>')->toString();
$this->assertBreadcrumb('admin/structure/block/block-content/manage/basic/fields', [
$front_page_path => 'Home',
'admin/structure/block' => 'Block layout',
'admin/structure/block/block-content' => 'Custom block library',
'admin/structure/block/block-content/manage/basic' => 'Bar',
]);
\Drupal::entityManager()->clearCachedFieldDefinitions(); \Drupal::entityManager()->clearCachedFieldDefinitions();
$this->drupalGet('block/add'); $this->drupalGet('block/add');

View file

@ -0,0 +1,54 @@
<?php
namespace Drupal\Tests\block_content\Kernel\Migrate;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Tests migration of block content body field display configuration.
*
* @group block_content
*/
class MigrateBlockContentEntityDisplayTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['block', 'block_content', 'filter', 'text'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->executeMigrations([
'block_content_type',
'block_content_body_field',
'block_content_entity_display',
]);
}
/**
* Asserts a display entity.
*
* @param string $id
* The entity ID.
* @param string $component_id
* The ID of the display component.
*/
protected function assertDisplay($id, $component_id) {
$component = EntityViewDisplay::load($id)->getComponent($component_id);
$this->assertInternalType('array', $component);
$this->assertSame('hidden', $component['label']);
}
/**
* Tests the migrated display configuration.
*/
public function testMigration() {
$this->assertDisplay('block_content.basic.default', 'body');
}
}

View file

@ -0,0 +1,54 @@
<?php
namespace Drupal\Tests\block_content\Kernel\Migrate;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Tests migration of block content body field form display configuration.
*
* @group block_content
*/
class MigrateBlockContentEntityFormDisplayTest extends MigrateDrupal7TestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['block', 'block_content', 'filter', 'text'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->executeMigrations([
'block_content_type',
'block_content_body_field',
'block_content_entity_form_display',
]);
}
/**
* Asserts a display entity.
*
* @param string $id
* The entity ID.
* @param string $component
* The ID of the form component.
*/
protected function assertDisplay($id, $component_id) {
$component = EntityFormDisplay::load($id)->getComponent($component_id);
$this->assertInternalType('array', $component);
$this->assertSame('text_textarea_with_summary', $component['type']);
}
/**
* Tests the migrated display configuration.
*/
public function testMigration() {
$this->assertDisplay('block_content.basic.default', 'body');
}
}

View file

@ -14,7 +14,7 @@ process:
method: process method: process
source: plid source: plid
- -
plugin: migration plugin: migration_lookup
migration: d6_book migration: d6_book
destination: destination:
plugin: book plugin: book

View file

@ -33,7 +33,7 @@ class MigrateBookConfigsTest extends MigrateDrupal6TestBase {
public function testBookSettings() { public function testBookSettings() {
$config = $this->config('book.settings'); $config = $this->config('book.settings');
$this->assertIdentical('book', $config->get('child_type')); $this->assertIdentical('book', $config->get('child_type'));
$this->assertIdentical('all pages', $config->get('block.navigation.mode')); $this->assertSame('book pages', $config->get('block.navigation.mode'));
$this->assertIdentical(['book'], $config->get('allowed_types')); $this->assertIdentical(['book'], $config->get('allowed_types'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'book.settings', $config->get()); $this->assertConfigSchema(\Drupal::service('config.typed'), 'book.settings', $config->get());
} }

View file

@ -15,7 +15,7 @@ class MigrateBookTest extends MigrateDrupal6TestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static $modules = ['book']; public static $modules = ['book', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -21,7 +21,7 @@ use Drupal\editor\Entity\Editor;
* @param $plugins * @param $plugins
* An array of all the existing plugin definitions, passed by reference. * An array of all the existing plugin definitions, passed by reference.
* *
* @see CKEditorPluginManager * @see \Drupal\ckeditor\CKEditorPluginManager
*/ */
function hook_ckeditor_plugin_info_alter(array &$plugins) { function hook_ckeditor_plugin_info_alter(array &$plugins) {
$plugins['someplugin']['label'] = t('Better name'); $plugins['someplugin']['label'] = t('Better name');

View file

@ -10,6 +10,7 @@ drupal.ckeditor:
- core/drupal - core/drupal
- core/drupalSettings - core/drupalSettings
- core/drupal.debounce - core/drupal.debounce
- core/drupal.displace
- core/ckeditor - core/ckeditor
- editor/drupal.editor - editor/drupal.editor
# Ensure to run after core/matchmedia. # Ensure to run after core/matchmedia.

View file

@ -35,8 +35,9 @@ interface CKEditorPluginButtonsInterface extends CKEditorPluginInterface {
* @return array * @return array
* An array of buttons that are provided by this plugin. This will * An array of buttons that are provided by this plugin. This will
* only be used in the administrative section for assembling the toolbar. * only be used in the administrative section for assembling the toolbar.
* Each button should by keyed by its CKEditor button name, and should * Each button should be keyed by its CKEditor button name (you can look up
* contain an array of button properties, including: * the button name up in the plugin.js file), and should contain an array of
* button properties, including:
* - label: A human-readable, translated button name. * - label: A human-readable, translated button name.
* - image: An image for the button to be used in the toolbar. * - image: An image for the button to be used in the toolbar.
* - image_rtl: If the image needs to have a right-to-left version, specify * - image_rtl: If the image needs to have a right-to-left version, specify

View file

@ -1,19 +1,19 @@
<?php <?php
namespace Drupal\ckeditor\Tests; namespace Drupal\Tests\ckeditor\Functional;
use Drupal\Component\Serialization\Json; use Drupal\Component\Serialization\Json;
use Drupal\editor\Entity\Editor; use Drupal\editor\Entity\Editor;
use Drupal\filter\FilterFormatInterface; use Drupal\filter\FilterFormatInterface;
use Drupal\simpletest\WebTestBase;
use Drupal\filter\Entity\FilterFormat; use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\BrowserTestBase;
/** /**
* Tests administration of CKEditor. * Tests administration of CKEditor.
* *
* @group ckeditor * @group ckeditor
*/ */
class CKEditorAdminTest extends WebTestBase { class CKEditorAdminTest extends BrowserTestBase {
/** /**
* Modules to enable. * Modules to enable.
@ -62,12 +62,12 @@ class CKEditorAdminTest extends WebTestBase {
$select = $this->xpath('//select[@name="editor[editor]"]'); $select = $this->xpath('//select[@name="editor[editor]"]');
$select_is_disabled = $this->xpath('//select[@name="editor[editor]" and @disabled="disabled"]'); $select_is_disabled = $this->xpath('//select[@name="editor[editor]" and @disabled="disabled"]');
$options = $this->xpath('//select[@name="editor[editor]"]/option'); $options = $this->xpath('//select[@name="editor[editor]"]/option');
$this->assertTrue(count($select) === 1, 'The Text Editor select exists.'); $this->assertCount(1, $select, 'The Text Editor select exists.');
$this->assertTrue(count($select_is_disabled) === 0, 'The Text Editor select is not disabled.'); $this->assertCount(0, $select_is_disabled, 'The Text Editor select is not disabled.');
$this->assertTrue(count($options) === 2, 'The Text Editor select has two options.'); $this->assertCount(2, $options, 'The Text Editor select has two options.');
$this->assertTrue(((string) $options[0]) === 'None', 'Option 1 in the Text Editor select is "None".'); $this->assertSame('None', $options[0]->getText(), 'Option 1 in the Text Editor select is "None".');
$this->assertTrue(((string) $options[1]) === 'CKEditor', 'Option 2 in the Text Editor select is "CKEditor".'); $this->assertSame('CKEditor', $options[1]->getText(), 'Option 2 in the Text Editor select is "CKEditor".');
$this->assertTrue(((string) $options[0]['selected']) === 'selected', 'Option 1 ("None") is selected.'); $this->assertSame('selected', $options[0]->getAttribute('selected'), 'Option 1 ("None") is selected.');
// Select the "CKEditor" editor and click the "Save configuration" button. // Select the "CKEditor" editor and click the "Save configuration" button.
$edit = [ $edit = [
@ -110,7 +110,7 @@ class CKEditorAdminTest extends WebTestBase {
$this->assertIdentical($this->castSafeStrings($ckeditor->getDefaultSettings()), $expected_default_settings); $this->assertIdentical($this->castSafeStrings($ckeditor->getDefaultSettings()), $expected_default_settings);
// Keep the "CKEditor" editor selected and click the "Configure" button. // Keep the "CKEditor" editor selected and click the "Configure" button.
$this->drupalPostAjaxForm(NULL, $edit, 'editor_configure'); $this->drupalPostForm(NULL, $edit, 'editor_configure');
$editor = Editor::load('filtered_html'); $editor = Editor::load('filtered_html');
$this->assertFalse($editor, 'No Editor config entity exists yet.'); $this->assertFalse($editor, 'No Editor config entity exists yet.');
@ -120,8 +120,10 @@ class CKEditorAdminTest extends WebTestBase {
'#editor' => Editor::create(['editor' => 'ckeditor']), '#editor' => Editor::create(['editor' => 'ckeditor']),
'#plugins' => $this->container->get('plugin.manager.ckeditor.plugin')->getButtons(), '#plugins' => $this->container->get('plugin.manager.ckeditor.plugin')->getButtons(),
]; ];
$settings = $this->getDrupalSettings();
$expected = $settings['ckeditor']['toolbarAdmin'];
$this->assertEqual( $this->assertEqual(
$this->drupalSettings['ckeditor']['toolbarAdmin'], $expected,
$this->container->get('renderer')->renderPlain($ckeditor_settings_toolbar), $this->container->get('renderer')->renderPlain($ckeditor_settings_toolbar),
'CKEditor toolbar settings are rendered as part of drupalSettings.' 'CKEditor toolbar settings are rendered as part of drupalSettings.'
); );
@ -230,12 +232,12 @@ class CKEditorAdminTest extends WebTestBase {
$select = $this->xpath('//select[@name="editor[editor]"]'); $select = $this->xpath('//select[@name="editor[editor]"]');
$select_is_disabled = $this->xpath('//select[@name="editor[editor]" and @disabled="disabled"]'); $select_is_disabled = $this->xpath('//select[@name="editor[editor]" and @disabled="disabled"]');
$options = $this->xpath('//select[@name="editor[editor]"]/option'); $options = $this->xpath('//select[@name="editor[editor]"]/option');
$this->assertTrue(count($select) === 1, 'The Text Editor select exists.'); $this->assertCount(1, $select, 'The Text Editor select exists.');
$this->assertTrue(count($select_is_disabled) === 0, 'The Text Editor select is not disabled.'); $this->assertCount(0, $select_is_disabled, 'The Text Editor select is not disabled.');
$this->assertTrue(count($options) === 2, 'The Text Editor select has two options.'); $this->assertCount(2, $options, 'The Text Editor select has two options.');
$this->assertTrue(((string) $options[0]) === 'None', 'Option 1 in the Text Editor select is "None".'); $this->assertSame('None', $options[0]->getText(), 'Option 1 in the Text Editor select is "None".');
$this->assertTrue(((string) $options[1]) === 'CKEditor', 'Option 2 in the Text Editor select is "CKEditor".'); $this->assertSame('CKEditor', $options[1]->getText(), 'Option 2 in the Text Editor select is "CKEditor".');
$this->assertTrue(((string) $options[0]['selected']) === 'selected', 'Option 1 ("None") is selected.'); $this->assertSame('selected', $options[0]->getAttribute('selected'), 'Option 1 ("None") is selected.');
// Name our fancy new text format, select the "CKEditor" editor and click // Name our fancy new text format, select the "CKEditor" editor and click
// the "Configure" button. // the "Configure" button.
@ -244,7 +246,7 @@ class CKEditorAdminTest extends WebTestBase {
'format' => 'amazing_format', 'format' => 'amazing_format',
'editor[editor]' => 'ckeditor', 'editor[editor]' => 'ckeditor',
]; ];
$this->drupalPostAjaxForm(NULL, $edit, 'editor_configure'); $this->drupalPostForm(NULL, $edit, 'editor_configure');
$filter_format = FilterFormat::load('amazing_format'); $filter_format = FilterFormat::load('amazing_format');
$this->assertFalse($filter_format, 'No FilterFormat config entity exists yet.'); $this->assertFalse($filter_format, 'No FilterFormat config entity exists yet.');
$editor = Editor::load('amazing_format'); $editor = Editor::load('amazing_format');
@ -258,7 +260,9 @@ class CKEditorAdminTest extends WebTestBase {
$this->assertFieldByName('editor[settings][toolbar][button_groups]', $expected_buttons_value); $this->assertFieldByName('editor[settings][toolbar][button_groups]', $expected_buttons_value);
// Regression test for https://www.drupal.org/node/2606460. // Regression test for https://www.drupal.org/node/2606460.
$this->assertTrue(strpos($this->drupalSettings['ckeditor']['toolbarAdmin'], '<li data-drupal-ckeditor-button-name="Bold" class="ckeditor-button"><a href="#" class="cke-icon-only cke_ltr" role="button" title="bold" aria-label="bold"><span class="cke_button_icon cke_button__bold_icon">bold</span></a></li>') !== FALSE); $settings = $this->getDrupalSettings();
$expected = $settings['ckeditor']['toolbarAdmin'];
$this->assertTrue(strpos($expected, '<li data-drupal-ckeditor-button-name="Bold" class="ckeditor-button"><a href="#" class="cke-icon-only cke_ltr" role="button" title="bold" aria-label="bold"><span class="cke_button_icon cke_button__bold_icon">bold</span></a></li>') !== FALSE);
// Ensure the styles textarea exists and is initialized empty. // Ensure the styles textarea exists and is initialized empty.
$styles_textarea = $this->xpath('//textarea[@name="editor[settings][plugins][stylescombo][styles]"]'); $styles_textarea = $this->xpath('//textarea[@name="editor[settings][plugins][stylescombo][styles]"]');

View file

@ -1,17 +1,17 @@
<?php <?php
namespace Drupal\ckeditor\Tests; namespace Drupal\Tests\ckeditor\Functional;
use Drupal\editor\Entity\Editor; use Drupal\editor\Entity\Editor;
use Drupal\simpletest\WebTestBase;
use Drupal\filter\Entity\FilterFormat; use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\BrowserTestBase;
/** /**
* Tests loading of CKEditor. * Tests loading of CKEditor.
* *
* @group ckeditor * @group ckeditor
*/ */
class CKEditorLoadingTest extends WebTestBase { class CKEditorLoadingTest extends BrowserTestBase {
/** /**
* Modules to enable. * Modules to enable.

View file

@ -1,17 +1,17 @@
<?php <?php
namespace Drupal\ckeditor\Tests; namespace Drupal\Tests\ckeditor\Functional;
use Drupal\editor\Entity\Editor; use Drupal\editor\Entity\Editor;
use Drupal\simpletest\WebTestBase;
use Drupal\filter\Entity\FilterFormat; use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\BrowserTestBase;
/** /**
* Tests administration of the CKEditor StylesCombo plugin. * Tests administration of the CKEditor StylesCombo plugin.
* *
* @group ckeditor * @group ckeditor
*/ */
class CKEditorStylesComboAdminTest extends WebTestBase { class CKEditorStylesComboAdminTest extends BrowserTestBase {
/** /**
* Modules to enable. * Modules to enable.

View file

@ -11,7 +11,7 @@ process:
# the cid field to allow incremental migrations. # the cid field to allow incremental migrations.
cid: cid cid: cid
pid: pid:
plugin: migration plugin: migration_lookup
migration: d6_comment migration: d6_comment
source: pid source: pid
entity_id: nid entity_id: nid
@ -32,7 +32,7 @@ process:
thread: thread thread: thread
'comment_body/value': comment 'comment_body/value': comment
'comment_body/format': 'comment_body/format':
plugin: migration plugin: migration_lookup
migration: d6_filter_format migration: d6_filter_format
source: format source: format
destination: destination:

View file

@ -11,7 +11,7 @@ process:
# the cid field to allow incremental migrations. # the cid field to allow incremental migrations.
cid: cid cid: cid
pid: pid:
plugin: migration plugin: migration_lookup
migration: d7_comment migration: d7_comment
source: pid source: pid
entity_id: nid entity_id: nid

View file

@ -10,7 +10,7 @@ use Drupal\Core\Session\AnonymousUserSession;
use Drupal\entity_test\Entity\EntityTest; use Drupal\entity_test\Entity\EntityTest;
use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldConfig;
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase; use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
use Drupal\simpletest\TestBase; use Drupal\Tests\Traits\Core\GeneratePermutationsTrait;
use Drupal\user\Entity\Role; use Drupal\user\Entity\Role;
use Drupal\user\RoleInterface; use Drupal\user\RoleInterface;
@ -23,6 +23,7 @@ use Drupal\user\RoleInterface;
class CommentFieldAccessTest extends EntityKernelTestBase { class CommentFieldAccessTest extends EntityKernelTestBase {
use CommentTestTrait; use CommentTestTrait;
use GeneratePermutationsTrait;
/** /**
* Modules to install. * Modules to install.
@ -203,7 +204,7 @@ class CommentFieldAccessTest extends EntityKernelTestBase {
'comment' => [$comment1, $comment2, $comment3, $comment4], 'comment' => [$comment1, $comment2, $comment3, $comment4],
'user' => [$comment_admin_user, $comment_enabled_user, $comment_no_edit_user, $comment_disabled_user, $anonymous_user] 'user' => [$comment_admin_user, $comment_enabled_user, $comment_no_edit_user, $comment_disabled_user, $anonymous_user]
]; ];
$permutations = TestBase::generatePermutations($combinations); $permutations = $this->generatePermutations($combinations);
// Check access to administrative fields. // Check access to administrative fields.
foreach ($this->administrativeFields as $field) { foreach ($this->administrativeFields as $field) {

View file

@ -17,7 +17,7 @@ class MigrateCommentTest extends MigrateDrupal6TestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static $modules = ['comment']; public static $modules = ['comment', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -11,6 +11,11 @@ use Drupal\Core\Entity\Entity\EntityViewDisplay;
*/ */
class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisplayBase { class MigrateCommentVariableEntityDisplayTest extends MigrateCommentVariableDisplayBase {
/**
* {@inheritdoc}
*/
public static $modules = ['menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View file

@ -11,6 +11,11 @@ use Drupal\Core\Entity\Entity\EntityFormDisplay;
*/ */
class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariableDisplayBase { class MigrateCommentVariableEntityFormDisplayTest extends MigrateCommentVariableDisplayBase {
/**
* {@inheritdoc}
*/
public static $modules = ['menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View file

@ -15,7 +15,7 @@ class MigrateCommentVariableFieldTest extends MigrateDrupal6TestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static $modules = ['comment']; public static $modules = ['comment', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -16,7 +16,7 @@ class MigrateCommentVariableInstanceTest extends MigrateDrupal6TestBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static $modules = ['comment']; public static $modules = ['comment', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -12,7 +12,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
*/ */
class MigrateCommentEntityDisplayTest extends MigrateDrupal7TestBase { class MigrateCommentEntityDisplayTest extends MigrateDrupal7TestBase {
public static $modules = ['node', 'comment', 'text']; public static $modules = ['node', 'comment', 'text', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -12,7 +12,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
*/ */
class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal7TestBase { class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal7TestBase {
public static $modules = ['node', 'comment', 'text']; public static $modules = ['node', 'comment', 'text', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -12,7 +12,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
*/ */
class MigrateCommentEntityFormDisplayTest extends MigrateDrupal7TestBase { class MigrateCommentEntityFormDisplayTest extends MigrateDrupal7TestBase {
public static $modules = ['node', 'comment', 'text']; public static $modules = ['node', 'comment', 'text', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -15,7 +15,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
*/ */
class MigrateCommentFieldInstanceTest extends MigrateDrupal7TestBase { class MigrateCommentFieldInstanceTest extends MigrateDrupal7TestBase {
public static $modules = ['node', 'comment', 'text']; public static $modules = ['node', 'comment', 'text', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -14,7 +14,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
*/ */
class MigrateCommentFieldTest extends MigrateDrupal7TestBase { class MigrateCommentFieldTest extends MigrateDrupal7TestBase {
public static $modules = ['node', 'comment', 'text']; public static $modules = ['node', 'comment', 'text', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -14,7 +14,7 @@ use Drupal\node\NodeInterface;
*/ */
class MigrateCommentTest extends MigrateDrupal7TestBase { class MigrateCommentTest extends MigrateDrupal7TestBase {
public static $modules = ['filter', 'node', 'comment', 'text']; public static $modules = ['filter', 'node', 'comment', 'text', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -13,7 +13,7 @@ use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
*/ */
class MigrateCommentTypeTest extends MigrateDrupal7TestBase { class MigrateCommentTypeTest extends MigrateDrupal7TestBase {
public static $modules = ['node', 'comment', 'text']; public static $modules = ['node', 'comment', 'text', 'menu_ui'];
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -0,0 +1,106 @@
<?php
namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/**
* Tests the Drupal 6 comment source w/ high water handling.
*
* @covers \Drupal\comment\Plugin\migrate\source\d6\Comment
*
* @group comment
*/
class CommentSourceWithHighWaterTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['comment', 'migrate_drupal'];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['comments'] = [
[
'cid' => 1,
'pid' => 0,
'nid' => 2,
'uid' => 3,
'subject' => 'subject value 1',
'comment' => 'comment value 1',
'hostname' => 'hostname value 1',
'timestamp' => 1382255613,
'status' => 0,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat1',
'type' => 'story',
],
[
'cid' => 2,
'pid' => 1,
'nid' => 3,
'uid' => 4,
'subject' => 'subject value 2',
'comment' => 'comment value 2',
'hostname' => 'hostname value 2',
'timestamp' => 1382255662,
'status' => 0,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat2',
'type' => 'page',
],
];
$tests[0]['source_data']['node'] = [
[
'nid' => 2,
'type' => 'story',
],
[
'nid' => 3,
'type' => 'page',
],
];
// The expected results.
$tests[0]['expected_data'] = [
[
'cid' => 2,
'pid' => 1,
'nid' => 3,
'uid' => 4,
'subject' => 'subject value 2',
'comment' => 'comment value 2',
'hostname' => 'hostname value 2',
'timestamp' => 1382255662,
'status' => 1,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat2',
'type' => 'page',
],
];
// The expected count is the count returned by the query before the query
// is modified by SqlBase::initializeIterator().
$tests[0]['expected_count'] = 2;
$tests[0]['configuration']['high_water_property']['name'] = 'timestamp';
$tests[0]['high_water'] = $tests[0]['source_data']['comments'][0]['timestamp'];
return $tests;
}
}

View file

@ -0,0 +1,116 @@
<?php
namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/**
* Tests D6 comment source plugin.
*
* @covers \Drupal\comment\Plugin\migrate\source\d6\Comment
* @group comment
*/
class CommentTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['comment', 'migrate_drupal'];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['comments'] = [
[
'cid' => 1,
'pid' => 0,
'nid' => 2,
'uid' => 3,
'subject' => 'subject value 1',
'comment' => 'comment value 1',
'hostname' => 'hostname value 1',
'timestamp' => 1382255613,
'status' => 0,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat1',
'type' => 'story',
],
[
'cid' => 2,
'pid' => 1,
'nid' => 3,
'uid' => 4,
'subject' => 'subject value 2',
'comment' => 'comment value 2',
'hostname' => 'hostname value 2',
'timestamp' => 1382255662,
'status' => 0,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat2',
'type' => 'page',
],
];
$tests[0]['source_data']['node'] = [
[
'nid' => 2,
'type' => 'story',
],
[
'nid' => 3,
'type' => 'page',
],
];
// The expected results.
$tests[0]['expected_data'] = [
[
'cid' => 1,
'pid' => 0,
'nid' => 2,
'uid' => 3,
'subject' => 'subject value 1',
'comment' => 'comment value 1',
'hostname' => 'hostname value 1',
'timestamp' => 1382255613,
'status' => 1,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat1',
'type' => 'story',
],
[
'cid' => 2,
'pid' => 1,
'nid' => 3,
'uid' => 4,
'subject' => 'subject value 2',
'comment' => 'comment value 2',
'hostname' => 'hostname value 2',
'timestamp' => 1382255662,
'status' => 1,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat2',
'type' => 'page',
],
];
return $tests;
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/**
* Tests comment variable per comment type source plugin.
*
* @covers \Drupal\comment\Plugin\migrate\source\d6\CommentVariablePerCommentType
* @group comment
*/
class CommentVariablePerCommentTypeTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['comment', 'migrate_drupal'];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['node_type'] = [
[
'type' => 'page',
],
[
'type' => 'story',
],
];
$tests[0]['source_data']['variable'] = [
[
'name' => 'comment_subject_field_page',
'value' => serialize(1),
],
[
'name' => 'comment_subject_field_story',
'value' => serialize(0),
],
];
// The expected results.
// Each result will also include a label and description, but those are
// static values set by the source plugin and don't need to be asserted.
$tests[0]['expected_data'] = [
[
'comment_type' => 'comment',
],
[
'comment_type' => 'comment_no_subject',
],
];
return $tests;
}
}

View file

@ -0,0 +1,92 @@
<?php
namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d6;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/**
* Tests d6_comment_variable source plugin.
*
* @covers \Drupal\comment\Plugin\migrate\source\d6\CommentVariable
* @group comment
*/
class CommentVariableTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['comment', 'migrate_drupal'];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['node_type'] = [
[
'type' => 'page',
],
];
$tests[0]['source_data']['variable'] = [
[
'name' => 'comment_page',
'value' => serialize(1),
],
[
'name' => 'comment_default_mode_page',
'value' => serialize(1),
],
[
'name' => 'comment_default_order_page',
'value' => serialize(1),
],
[
'name' => 'comment_default_per_page_page',
'value' => serialize(50),
],
[
'name' => 'comment_controls_page',
'value' => serialize(1),
],
[
'name' => 'comment_anonymous_page',
'value' => serialize(1),
],
[
'name' => 'comment_subject_field_page',
'value' => serialize(1),
],
[
'name' => 'comment_preview_page',
'value' => serialize(1),
],
[
'name' => 'comment_form_location_page',
'value' => serialize(1),
],
];
// The expected results.
$tests[0]['expected_data'] = [
[
'comment' => '1',
'comment_default_mode' => '1',
'comment_default_order' => '1',
'comment_default_per_page' => '50',
'comment_controls' => '1',
'comment_anonymous' => '1',
'comment_subject_field' => '1',
'comment_preview' => '1',
'comment_form_location' => '1',
'node_type' => 'page',
'comment_type' => 'comment',
],
];
return $tests;
}
}

View file

@ -0,0 +1,117 @@
<?php
namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d7;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/**
* Tests D7 comment source plugin.
*
* @covers \Drupal\comment\Plugin\migrate\source\d7\Comment
* @group comment
*/
class CommentTest extends MigrateSqlSourceTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['comment', 'migrate_drupal'];
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['comment'] = [
[
'cid' => '1',
'pid' => '0',
'nid' => '1',
'uid' => '1',
'subject' => 'A comment',
'hostname' => '::1',
'created' => '1421727536',
'changed' => '1421727536',
'status' => '1',
'thread' => '01/',
'name' => 'admin',
'mail' => '',
'homepage' => '',
'language' => 'und',
],
];
$tests[0]['source_data']['node'] = [
[
'nid' => '1',
'vid' => '1',
'type' => 'test_content_type',
'language' => 'en',
'title' => 'A Node',
'uid' => '1',
'status' => '1',
'created' => '1421727515',
'changed' => '1421727515',
'comment' => '2',
'promote' => '1',
'sticky' => '0',
'tnid' => '0',
'translate' => '0',
],
];
$tests[0]['source_data']['field_config_instance'] = [
[
'id' => '14',
'field_id' => '1',
'field_name' => 'comment_body',
'entity_type' => 'comment',
'bundle' => 'comment_node_test_content_type',
'data' => 'a:0:{}',
'deleted' => '0',
],
];
$tests[0]['source_data']['field_data_comment_body'] = [
[
'entity_type' => 'comment',
'bundle' => 'comment_node_test_content_type',
'deleted' => '0',
'entity_id' => '1',
'revision_id' => '1',
'language' => 'und',
'delta' => '0',
'comment_body_value' => 'This is a comment',
'comment_body_format' => 'filtered_html',
],
];
// The expected results.
$tests[0]['expected_data'] = [
[
'cid' => '1',
'pid' => '0',
'nid' => '1',
'uid' => '1',
'subject' => 'A comment',
'hostname' => '::1',
'created' => '1421727536',
'changed' => '1421727536',
'status' => '1',
'thread' => '01/',
'name' => 'admin',
'mail' => '',
'homepage' => '',
'language' => 'und',
'comment_body' => [
[
'value' => 'This is a comment',
'format' => 'filtered_html',
],
],
],
];
return $tests;
}
}

View file

@ -1,44 +1,30 @@
<?php <?php
namespace Drupal\Tests\comment\Unit\Migrate\d7; namespace Drupal\Tests\comment\Kernel\Plugin\migrate\source\d7;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase; use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
/** /**
* Tests D7 comment type source plugin. * Tests D7 comment type source plugin.
* *
* @covers \Drupal\comment\Plugin\migrate\source\d7\CommentType
* @group comment * @group comment
*/ */
class CommentTypeTest extends MigrateSqlSourceTestCase { class CommentTypeTest extends MigrateSqlSourceTestBase {
const PLUGIN_CLASS = 'Drupal\comment\Plugin\migrate\source\d7\CommentType';
protected $migrationConfiguration = [
'id' => 'test',
'source' => [
'plugin' => 'd7_comment_type',
],
];
protected $expectedResults = [
[
'bundle' => 'comment_node_article',
'node_type' => 'article',
'default_mode' => '1',
'per_page' => '50',
'anonymous' => '0',
'form_location' => '1',
'preview' => '0',
'subject' => '1',
'label' => 'Article comment',
],
];
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { public static $modules = ['comment', 'migrate_drupal'];
$this->databaseContents['node_type'] = [
/**
* {@inheritdoc}
*/
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['node_type'] = [
[ [
'type' => 'article', 'type' => 'article',
'name' => 'Article', 'name' => 'Article',
@ -55,7 +41,7 @@ class CommentTypeTest extends MigrateSqlSourceTestCase {
'orig_type' => 'article', 'orig_type' => 'article',
], ],
]; ];
$this->databaseContents['field_config_instance'] = [ $tests[0]['source_data']['field_config_instance'] = [
[ [
'id' => '14', 'id' => '14',
'field_id' => '1', 'field_id' => '1',
@ -66,7 +52,7 @@ class CommentTypeTest extends MigrateSqlSourceTestCase {
'deleted' => '0', 'deleted' => '0',
], ],
]; ];
$this->databaseContents['variable'] = [ $tests[0]['source_data']['variable'] = [
[ [
'name' => 'comment_default_mode_article', 'name' => 'comment_default_mode_article',
'value' => serialize(1), 'value' => serialize(1),
@ -92,7 +78,22 @@ class CommentTypeTest extends MigrateSqlSourceTestCase {
'value' => serialize(1), 'value' => serialize(1),
], ],
]; ];
parent::setUp();
// The expected results.
$tests[0]['expected_data'] = [
[
'bundle' => 'comment_node_article',
'node_type' => 'article',
'default_mode' => '1',
'per_page' => '50',
'anonymous' => '0',
'form_location' => '1',
'preview' => '0',
'subject' => '1',
'label' => 'Article comment',
],
];
return $tests;
} }
} }

View file

@ -6,7 +6,7 @@ use Drupal\comment\CommentLinkBuilder;
use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
use Drupal\Core\Url; use Drupal\Core\Url;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Drupal\simpletest\TestBase; use Drupal\Tests\Traits\Core\GeneratePermutationsTrait;
use Drupal\Tests\UnitTestCase; use Drupal\Tests\UnitTestCase;
/** /**
@ -15,6 +15,8 @@ use Drupal\Tests\UnitTestCase;
*/ */
class CommentLinkBuilderTest extends UnitTestCase { class CommentLinkBuilderTest extends UnitTestCase {
use GeneratePermutationsTrait;
/** /**
* Comment manager mock. * Comment manager mock.
* *
@ -195,7 +197,7 @@ class CommentLinkBuilderTest extends UnitTestCase {
'teaser', 'rss', 'full', 'teaser', 'rss', 'full',
], ],
]; ];
$permutations = TestBase::generatePermutations($combinations); $permutations = $this->generatePermutations($combinations);
foreach ($permutations as $combination) { foreach ($permutations as $combination) {
$case = [ $case = [
$this->getMockNode(TRUE, $combination['comments'], $combination['form_location'], $combination['comment_count']), $this->getMockNode(TRUE, $combination['comments'], $combination['form_location'], $combination['comment_count']),

View file

@ -1,23 +0,0 @@
<?php
namespace Drupal\Tests\comment\Unit\Migrate\d6;
/**
* Tests the Drupal 6 comment source w/ high water handling.
*
* @group comment
*/
class CommentSourceWithHighWaterTest extends CommentTestBase {
const ORIGINAL_HIGH_WATER = 1382255613;
/**
* {@inheritdoc}
*/
protected function setUp() {
$this->migrationConfiguration['source']['high_water_property']['name'] = 'timestamp';
array_shift($this->expectedResults);
parent::setUp();
}
}

View file

@ -1,12 +0,0 @@
<?php
namespace Drupal\Tests\comment\Unit\Migrate\d6;
/**
* Tests D6 comment source plugin.
*
* @group comment
*/
class CommentTest extends CommentTestBase {
}

View file

@ -1,80 +0,0 @@
<?php
namespace Drupal\Tests\comment\Unit\Migrate\d6;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
/**
* Base class for comment source unit tests.
*/
abstract class CommentTestBase extends MigrateSqlSourceTestCase {
// The plugin system is not working during unit testing so the source plugin
// class needs to be manually specified.
const PLUGIN_CLASS = 'Drupal\comment\Plugin\migrate\source\d6\Comment';
// The fake Migration configuration entity.
protected $migrationConfiguration = [
// The ID of the entity, can be any string.
'id' => 'test',
// This needs to be the identifier of the actual key: cid for comment, nid
// for node and so on.
'source' => [
'plugin' => 'd6_comment',
],
];
// We need to set up the database contents; it's easier to do that below.
protected $expectedResults = [
[
'cid' => 1,
'pid' => 0,
'nid' => 2,
'uid' => 3,
'subject' => 'subject value 1',
'comment' => 'comment value 1',
'hostname' => 'hostname value 1',
'timestamp' => 1382255613,
'status' => 1,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat1',
'type' => 'story',
],
[
'cid' => 2,
'pid' => 1,
'nid' => 3,
'uid' => 4,
'subject' => 'subject value 2',
'comment' => 'comment value 2',
'hostname' => 'hostname value 2',
'timestamp' => 1382255662,
'status' => 1,
'thread' => '',
'name' => '',
'mail' => '',
'homepage' => '',
'format' => 'testformat2',
'type' => 'page',
],
];
/**
* {@inheritdoc}
*/
protected function setUp() {
foreach ($this->expectedResults as $k => $row) {
$this->databaseContents['comments'][$k] = $row;
$this->databaseContents['comments'][$k]['status'] = 1 - $this->databaseContents['comments'][$k]['status'];
}
// Add node table data.
$this->databaseContents['node'][] = ['nid' => 2, 'type' => 'story'];
$this->databaseContents['node'][] = ['nid' => 3, 'type' => 'page'];
parent::setUp();
}
}

View file

@ -1,59 +0,0 @@
<?php
namespace Drupal\Tests\comment\Unit\Migrate\d6;
use Drupal\comment\Plugin\migrate\source\d6\CommentVariablePerCommentType;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
/**
* @coversDefaultClass \Drupal\comment\Plugin\migrate\source\d6\CommentVariablePerCommentType
* @group comment
*/
class CommentVariablePerCommentTypeTest extends MigrateSqlSourceTestCase {
const PLUGIN_CLASS = CommentVariablePerCommentType::class;
protected $migrationConfiguration = [
'id' => 'test',
'source' => [
'plugin' => 'd6_comment_variable_per_comment_type',
],
];
protected $expectedResults = [
// Each result will also include a label and description, but those are
// static values set by the source plugin and don't need to be asserted.
[
'comment_type' => 'comment',
],
[
'comment_type' => 'comment_no_subject',
],
];
/**
* {@inheritdoc}
*/
protected function setUp() {
$this->databaseContents['node_type'] = [
[
'type' => 'page',
],
[
'type' => 'story',
],
];
$this->databaseContents['variable'] = [
[
'name' => 'comment_subject_field_page',
'value' => serialize(1),
],
[
'name' => 'comment_subject_field_story',
'value' => serialize(0),
],
];
parent::setUp();
}
}

View file

@ -1,89 +0,0 @@
<?php
namespace Drupal\Tests\comment\Unit\Migrate\d6;
use Drupal\comment\Plugin\migrate\source\d6\CommentVariable;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
/**
* @coversDefaultClass \Drupal\comment\Plugin\migrate\source\d6\CommentVariable
* @group comment
*/
class CommentVariableTest extends MigrateSqlSourceTestCase {
const PLUGIN_CLASS = CommentVariable::class;
protected $migrationConfiguration = [
'id' => 'test',
'source' => [
'plugin' => 'd6_comment_variable',
],
];
protected $expectedResults = [
[
'comment' => '1',
'comment_default_mode' => '1',
'comment_default_order' => '1',
'comment_default_per_page' => '50',
'comment_controls' => '1',
'comment_anonymous' => '1',
'comment_subject_field' => '1',
'comment_preview' => '1',
'comment_form_location' => '1',
'node_type' => 'page',
'comment_type' => 'comment',
],
];
/**
* {@inheritdoc}
*/
protected function setUp() {
$this->databaseContents['node_type'] = [
[
'type' => 'page',
],
];
$this->databaseContents['variable'] = [
[
'name' => 'comment_page',
'value' => serialize(1),
],
[
'name' => 'comment_default_mode_page',
'value' => serialize(1),
],
[
'name' => 'comment_default_order_page',
'value' => serialize(1),
],
[
'name' => 'comment_default_per_page_page',
'value' => serialize(50),
],
[
'name' => 'comment_controls_page',
'value' => serialize(1),
],
[
'name' => 'comment_anonymous_page',
'value' => serialize(1),
],
[
'name' => 'comment_subject_field_page',
'value' => serialize(1),
],
[
'name' => 'comment_preview_page',
'value' => serialize(1),
],
[
'name' => 'comment_form_location_page',
'value' => serialize(1),
],
];
parent::setUp();
}
}

View file

@ -1,100 +0,0 @@
<?php
namespace Drupal\Tests\comment\Unit\Migrate\d7;
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
/**
* Tests D7 comment source plugin.
*
* @group comment
*/
class CommentTest extends MigrateSqlSourceTestCase {
const PLUGIN_CLASS = 'Drupal\comment\Plugin\migrate\source\d7\Comment';
protected $migrationConfiguration = [
'id' => 'test',
'source' => [
'plugin' => 'd7_comment',
],
];
protected $expectedResults = [
[
'cid' => '1',
'pid' => '0',
'nid' => '1',
'uid' => '1',
'subject' => 'A comment',
'hostname' => '::1',
'created' => '1421727536',
'changed' => '1421727536',
'status' => '1',
'thread' => '01/',
'name' => 'admin',
'mail' => '',
'homepage' => '',
'language' => 'und',
'comment_body' => [
[
'value' => 'This is a comment',
'format' => 'filtered_html',
],
],
],
];
/**
* {@inheritdoc}
*/
protected function setUp() {
$this->databaseContents['comment'] = $this->expectedResults;
unset($this->databaseContents['comment'][0]['comment_body']);
$this->databaseContents['node'] = [
[
'nid' => '1',
'vid' => '1',
'type' => 'test_content_type',
'language' => 'en',
'title' => 'A Node',
'uid' => '1',
'status' => '1',
'created' => '1421727515',
'changed' => '1421727515',
'comment' => '2',
'promote' => '1',
'sticky' => '0',
'tnid' => '0',
'translate' => '0',
],
];
$this->databaseContents['field_config_instance'] = [
[
'id' => '14',
'field_id' => '1',
'field_name' => 'comment_body',
'entity_type' => 'comment',
'bundle' => 'comment_node_test_content_type',
'data' => 'a:0:{}',
'deleted' => '0',
],
];
$this->databaseContents['field_data_comment_body'] = [
[
'entity_type' => 'comment',
'bundle' => 'comment_node_test_content_type',
'deleted' => '0',
'entity_id' => '1',
'revision_id' => '1',
'language' => 'und',
'delta' => '0',
'comment_body_value' => 'This is a comment',
'comment_body_format' => 'filtered_html',
],
];
parent::setUp();
}
}

View file

@ -155,6 +155,29 @@ EOD;
]; ];
$this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import')); $this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import'));
$this->assertRaw(t('Configuration %name depends on the %owner module that will not be installed after import.', ['%name' => 'config_test.dynamic.second', '%owner' => 'does_not_exist'])); $this->assertRaw(t('Configuration %name depends on the %owner module that will not be installed after import.', ['%name' => 'config_test.dynamic.second', '%owner' => 'does_not_exist']));
// Try to preform an update which would create a PHP object if Yaml parsing
// not securely set up.
// Perform an update.
$import = <<<EOD
id: second
uuid: $second_uuid
label: !php/object "O:36:\"Drupal\\\Core\\\Test\\\ObjectSerialization\":0:{}"
weight: 0
style: ''
status: '0'
EOD;
$edit = [
'config_type' => 'config_test',
'import' => $import,
];
$this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import'));
$this->assertRaw(t('Are you sure you want to update the %name @type?', ['%name' => 'second', '@type' => 'test configuration']));
$this->drupalPostForm(NULL, [], t('Confirm'));
$entity = $storage->load('second');
$this->assertRaw(t('The configuration was imported successfully.'));
$this->assertTrue(is_string($entity->label()), 'Entity label is a string');
$this->assertTrue(strpos($entity->label(), 'ObjectSerialization') > 0, 'Label contains serialized object');
} }
/** /**

Some files were not shown because too many files have changed in this diff Show more