reverted:
--- b/core/lib/Drupal/Component/Diff/Engine/DiffEngine.php
+++ a/core/lib/Drupal/Component/Diff/Engine/DiffEngine.php
@@ -320,7 +320,7 @@
reset($seps);
$pt1 = $seps[0];
while ($pt2 = next($seps)) {
+ $this->_compareseq ($pt1[0], $pt2[0], $pt1[1], $pt2[1]);
- $this->_compareseq($pt1[0], $pt2[0], $pt1[1], $pt2[1]);
$pt1 = $pt2;
}
}
diff -u b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
--- b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
@@ -296,9 +296,7 @@
$this->assertCount(1, $revision_field_data['table']['join']);
$this->assertEquals([
'entity_test_mul_property_data' => [
- 'left_field' => 'revision_id',
- 'field' => 'revision_id',
- 'type' => 'INNER',
+ 'left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER'
],
], $revision_field_data['table']['join']);
@@ -306,9 +304,7 @@
$this->assertCount(1, $revision_base_data['table']['join']);
$this->assertEquals([
'entity_test_mulrev_property_revision' => [
- 'left_field' => 'revision_id',
- 'field' => 'revision_id',
- 'type' => 'INNER',
+ 'left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER'
],
], $revision_base_data['table']['join']);
@@ -343,9 +339,7 @@
$this->assertCount(1, $revision_field_data['table']['join']);
$this->assertEquals([
'entity_test_mulrev_field_data' => [
- 'left_field' => 'revision_id',
- 'field' => 'revision_id',
- 'type' => 'INNER',
+ 'left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER'
],
], $revision_field_data['table']['join']);
@@ -353,9 +347,7 @@
$this->assertCount(1, $revision_base_data['table']['join']);
$this->assertEquals([
'entity_test_mulrev_property_revision' => [
- 'left_field' => 'revision_id',
- 'field' => 'revision_id',
- 'type' => 'INNER',
+ 'left_field' => 'revision_id', 'field' => 'revision_id', 'type' => 'INNER'
],
], $revision_base_data['table']['join']);
$this->assertFalse(isset($data['data_table']));
@@ -537,11 +529,10 @@
'left_field' => 'id',
'field' => 'entity_id',
'extra' => [[
- 'field' => 'deleted',
- 'value' => 0,
- 'numeric' => TRUE,
- ],
- ],
+ 'field' => 'deleted',
+ 'value' => 0,
+ 'numeric' => TRUE,
+ ]],
], $data['entity_test__string']['table']['join']['entity_test']);
}
@@ -692,11 +683,10 @@
'left_field' => 'id',
'field' => 'entity_id',
'extra' => [[
- 'field' => 'deleted',
- 'value' => 0,
- 'numeric' => TRUE,
- ],
- ],
+ 'field' => 'deleted',
+ 'value' => 0,
+ 'numeric' => TRUE,
+ ]],
], $data['entity_test_mul__string']['table']['join']['entity_test_mul']);
}
@@ -878,11 +868,10 @@
'left_field' => 'id',
'field' => 'entity_id',
'extra' => [[
- 'field' => 'deleted',
- 'value' => 0,
- 'numeric' => TRUE,
- ],
- ],
+ 'field' => 'deleted',
+ 'value' => 0,
+ 'numeric' => TRUE,
+ ]],
], $data['entity_test_mulrev__string']['table']['join']['entity_test_mulrev_property_data']);
$this->assertStringField($data['entity_test_mulrev_revision__string']['string']);
@@ -891,11 +880,10 @@
'left_field' => 'revision_id',
'field' => 'entity_id',
'extra' => [[
- 'field' => 'deleted',
- 'value' => 0,
- 'numeric' => TRUE,
- ],
- ],
+ 'field' => 'deleted',
+ 'value' => 0,
+ 'numeric' => TRUE,
+ ]],
], $data['entity_test_mulrev_revision__string']['table']['join']['entity_test_mulrev_property_revision']);
}
diff -u b/core/phpcs.xml.dist b/core/phpcs.xml.dist
--- b/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -88,8 +88,8 @@
-
+
@@ -104,7 +104,6 @@
-
@@ -115,7 +114,6 @@
-
@@ -146,6 +144,9 @@
+
0
@@ -173,55 +174,6 @@
-
-
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
diff -u b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
--- b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
@@ -362,9 +362,7 @@
public function providerTestToUrlUriCallback() {
$test_cases = [];
- $uri_callback = function () {
- return Url::fromRoute('');
- };
+ $uri_callback = function () { return Url::fromRoute(''); };
$test_cases['uri_callback'] = [[], $uri_callback];
$test_cases['bundle_uri_callback'] = [['uri_callback' => $uri_callback], NULL];
diff -u b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
--- b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php
@@ -164,11 +164,9 @@
$route
->setDefault('bundle_parameter', 'the_bundle_entity_type_id')
->setRequirement('_entity_create_access', 'the_entity_type_id:{the_bundle_entity_type_id}')
- ->setOption('parameters', [
- 'the_bundle_entity_type_id' => [
- 'type' => 'entity:the_bundle_entity_type_id',
- ],
- ]);
+ ->setOption('parameters', ['the_bundle_entity_type_id' => [
+ 'type' => 'entity:the_bundle_entity_type_id',
+ ]]);
$data['add_form_bundle_entity_id_key_type_null'] = [clone $route, $entity_type5->reveal(), $bundle_entity_type->reveal()];
$entity_type6 = $this->getEntityType($entity_type5);
@@ -186,12 +184,10 @@
$route
// Unset the 'the_entity_type_id' requirement.
->setRequirements(['_entity_create_access' => $route->getRequirement('_entity_create_access')])
- ->setOption('parameters', [
- 'the_bundle_entity_type_id' => [
- 'type' => 'entity:the_bundle_entity_type_id',
- 'with_config_overrides' => TRUE,
- ],
- ]);
+ ->setOption('parameters', ['the_bundle_entity_type_id' => [
+ 'type' => 'entity:the_bundle_entity_type_id',
+ 'with_config_overrides' => TRUE,
+ ]]);
$data['add_form_bundle_entity_id_key_type_integer'] = [clone $route, $entity_type7->reveal(), $bundle_entity_type->reveal(), $field_storage_definition->reveal()];
return $data;
only in patch2:
unchanged:
--- a/composer.lock
+++ b/composer.lock
@@ -60,16 +60,16 @@
},
{
"name": "composer/installers",
- "version": "v1.4.0",
+ "version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/composer/installers.git",
- "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b"
+ "reference": "d78064c68299743e0161004f2de3a0204e33b804"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b",
- "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b",
+ "url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804",
+ "reference": "d78064c68299743e0161004f2de3a0204e33b804",
"shasum": ""
},
"require": {
@@ -111,17 +111,12 @@
"keywords": [
"Craft",
"Dolibarr",
- "Eliasis",
"Hurad",
"ImageCMS",
- "Kanboard",
- "Lan Management System",
"MODX Evo",
"Mautic",
- "Maya",
"OXID",
"Plentymarkets",
- "Porto",
"RadPHP",
"SMF",
"Thelia",
@@ -139,24 +134,20 @@
"croogo",
"dokuwiki",
"drupal",
- "eZ Platform",
"elgg",
"expressionengine",
"fuelphp",
"grav",
"installer",
- "itop",
"joomla",
"kohana",
"laravel",
- "lavalite",
"lithium",
"magento",
"mako",
"mediawiki",
"modulework",
"moodle",
- "osclass",
"phpbb",
"piwik",
"ppi",
@@ -165,7 +156,6 @@
"roundcube",
"shopware",
"silverstripe",
- "sydes",
"symfony",
"typo3",
"wordpress",
@@ -173,7 +163,7 @@
"zend",
"zikula"
],
- "time": "2017-08-09T07:53:48+00:00"
+ "time": "2016-08-13T20:53:52+00:00"
},
{
"name": "composer/semver",
@@ -751,16 +741,16 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "6.3.0",
+ "version": "6.2.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
+ "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
- "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006",
+ "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006",
"shasum": ""
},
"require": {
@@ -770,12 +760,9 @@
},
"require-dev": {
"ext-curl": "*",
- "phpunit/phpunit": "^4.0 || ^5.0",
+ "phpunit/phpunit": "^4.0",
"psr/log": "^1.0"
},
- "suggest": {
- "psr/log": "Required for using the Log middleware"
- },
"type": "library",
"extra": {
"branch-alias": {
@@ -812,7 +799,7 @@
"rest",
"web service"
],
- "time": "2017-06-22T18:50:49+00:00"
+ "time": "2017-02-28T22:50:30+00:00"
},
{
"name": "guzzlehttp/promises",
@@ -932,16 +919,16 @@
},
{
"name": "masterminds/html5",
- "version": "2.3.0",
+ "version": "2.2.2",
"source": {
"type": "git",
"url": "https://github.com/Masterminds/html5-php.git",
- "reference": "2c37c6c520b995b761674de3be8455a381679067"
+ "reference": "7866e93dcf0245de22378414e0c2c7350abc45af"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/2c37c6c520b995b761674de3be8455a381679067",
- "reference": "2c37c6c520b995b761674de3be8455a381679067",
+ "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/7866e93dcf0245de22378414e0c2c7350abc45af",
+ "reference": "7866e93dcf0245de22378414e0c2c7350abc45af",
"shasum": ""
},
"require": {
@@ -993,7 +980,7 @@
"serializer",
"xml"
],
- "time": "2017-09-04T12:26:28+00:00"
+ "time": "2016-09-22T11:01:11+00:00"
},
{
"name": "paragonie/random_compat",
@@ -1191,16 +1178,16 @@
},
{
"name": "symfony-cmf/routing",
- "version": "1.4.1",
+ "version": "1.4.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony-cmf/routing.git",
- "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac"
+ "url": "https://github.com/symfony-cmf/Routing.git",
+ "reference": "b93704ca098334f56e9b317932f21a4362e620db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony-cmf/routing/zipball/fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac",
- "reference": "fb1e7f85ff8c6866238b7e73a490a0a0243ae8ac",
+ "url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/b93704ca098334f56e9b317932f21a4362e620db",
+ "reference": "b93704ca098334f56e9b317932f21a4362e620db",
"shasum": ""
},
"require": {
@@ -1246,7 +1233,7 @@
"database",
"routing"
],
- "time": "2017-05-09T08:10:41+00:00"
+ "time": "2016-03-31T09:11:39+00:00"
},
{
"name": "symfony/class-loader",
@@ -2319,16 +2306,16 @@
},
{
"name": "wikimedia/composer-merge-plugin",
- "version": "v1.4.1",
+ "version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/wikimedia/composer-merge-plugin.git",
- "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100"
+ "reference": "ca453f9f13d8b05f86f20ea10be992a782e6f78c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100",
- "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100",
+ "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/ca453f9f13d8b05f86f20ea10be992a782e6f78c",
+ "reference": "ca453f9f13d8b05f86f20ea10be992a782e6f78c",
"shasum": ""
},
"require": {
@@ -2364,20 +2351,20 @@
}
],
"description": "Composer plugin to merge multiple composer.json files",
- "time": "2017-04-25T02:31:25+00:00"
+ "time": "2017-03-13T16:52:55+00:00"
},
{
"name": "zendframework/zend-diactoros",
- "version": "1.4.1",
+ "version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-diactoros.git",
- "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef"
+ "reference": "b03f285a333f51e58c95cce54109a4a9ed691436"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/424a840dc3bedcdeea510b42e056c77c2d6c4bef",
- "reference": "424a840dc3bedcdeea510b42e056c77c2d6c4bef",
+ "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/b03f285a333f51e58c95cce54109a4a9ed691436",
+ "reference": "b03f285a333f51e58c95cce54109a4a9ed691436",
"shasum": ""
},
"require": {
@@ -2416,7 +2403,7 @@
"psr",
"psr-7"
],
- "time": "2017-08-17T21:21:00+00:00"
+ "time": "2017-04-06T16:18:34+00:00"
},
{
"name": "zendframework/zend-escaper",
@@ -3041,16 +3028,16 @@
},
{
"name": "mikey179/vfsStream",
- "version": "v1.6.5",
+ "version": "v1.6.4",
"source": {
"type": "git",
"url": "https://github.com/mikey179/vfsStream.git",
- "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145"
+ "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145",
- "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145",
+ "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/0247f57b2245e8ad2e689d7cee754b45fbabd592",
+ "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592",
"shasum": ""
},
"require": {
@@ -3083,7 +3070,7 @@
],
"description": "Virtual file system to mock the real file system in unit tests.",
"homepage": "http://vfs.bovigo.org/",
- "time": "2017-08-01T08:02:14+00:00"
+ "time": "2016-07-18T14:02:57+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
@@ -3447,16 +3434,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "4.8.36",
+ "version": "4.8.35",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "46023de9a91eec7dfb06cc56cb4e260017298517"
+ "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517",
- "reference": "46023de9a91eec7dfb06cc56cb4e260017298517",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87",
+ "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87",
"shasum": ""
},
"require": {
@@ -3515,7 +3502,7 @@
"testing",
"xunit"
],
- "time": "2017-06-21T08:07:12+00:00"
+ "time": "2017-02-06T05:18:07+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
only in patch2:
unchanged:
--- a/core/core.link_relation_types.yml
+++ b/core/core.link_relation_types.yml
@@ -3,9 +3,6 @@
add-form:
uri: https://drupal.org/link-relations/add-form
description: A form where a resource of this type can be created.
-add-page:
- uri: https://drupal.org/link-relations/add-page
- description: A page where a resource of this type and related types can be created.
delete-form:
uri: https://drupal.org/link-relations/delete-form
description: A form where a resource of this type can be deleted.
only in patch2:
unchanged:
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -754,7 +754,8 @@ function install_tasks($install_state) {
'run' => $install_state['settings_verified'] ? INSTALL_TASK_SKIP : INSTALL_TASK_RUN_IF_NOT_COMPLETED,
'function' => 'Drupal\Core\Installer\Form\SiteSettingsForm',
],
- 'install_write_profile' => [],
+ 'install_write_profile' => [
+ ],
'install_verify_database_ready' => [
'run' => $install_state['database_ready'] ? INSTALL_TASK_SKIP : INSTALL_TASK_RUN_IF_NOT_COMPLETED,
],
@@ -769,8 +770,10 @@ function install_tasks($install_state) {
'display_name' => t('Install site'),
'type' => 'batch',
],
- 'install_profile_themes' => [],
- 'install_install_profile' => [],
+ 'install_profile_themes' => [
+ ],
+ 'install_install_profile' => [
+ ],
'install_import_translations' => [
'display_name' => t('Set up translations'),
'display' => $needs_translations,
@@ -810,7 +813,8 @@ function install_tasks($install_state) {
'type' => 'batch',
'run' => $needs_translations ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
],
- 'install_finished' => [],
+ 'install_finished' => [
+ ],
];
// Allow the installation profile to modify the full list of tasks.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Gettext/PoStreamWriter.php
+++ b/core/lib/Drupal/Component/Gettext/PoStreamWriter.php
@@ -104,7 +104,7 @@ public function close() {
* If writing the data is not possible.
*/
private function write($data) {
- $result = fwrite($this->_fd, $data);
+ $result = fputs($this->_fd, $data);
if ($result === FALSE) {
throw new Exception('Unable to write data: ' . substr($data, 0, 20));
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Plugin/Exception/ContextException.php
+++ b/core/lib/Drupal/Component/Plugin/Exception/ContextException.php
@@ -5,4 +5,4 @@
/**
* An exception class to be thrown for context plugin exceptions.
*/
-class ContextException extends \Exception implements ExceptionInterface {}
+class ContextException extends \Exception implements ExceptionInterface { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Plugin/Exception/ExceptionInterface.php
+++ b/core/lib/Drupal/Component/Plugin/Exception/ExceptionInterface.php
@@ -5,4 +5,4 @@
/**
* Exception interface for all exceptions thrown by the Plugin component.
*/
-interface ExceptionInterface {}
+interface ExceptionInterface { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Plugin/Exception/InvalidDecoratedMethod.php
+++ b/core/lib/Drupal/Component/Plugin/Exception/InvalidDecoratedMethod.php
@@ -8,4 +8,4 @@
* Exception thrown when a decorator's _call() method is triggered, but the
* decorated object does not contain the requested method.
*/
-class InvalidDecoratedMethod extends BadMethodCallException implements ExceptionInterface {}
+class InvalidDecoratedMethod extends BadMethodCallException implements ExceptionInterface { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Plugin/Exception/InvalidDeriverException.php
+++ b/core/lib/Drupal/Component/Plugin/Exception/InvalidDeriverException.php
@@ -5,4 +5,4 @@
/**
* Exception to be thrown if a plugin tries to use an invalid deriver.
*/
-class InvalidDeriverException extends PluginException {}
+class InvalidDeriverException extends PluginException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Plugin/Exception/MapperExceptionInterface.php
+++ b/core/lib/Drupal/Component/Plugin/Exception/MapperExceptionInterface.php
@@ -8,4 +8,4 @@
* Extended interface for exceptions thrown specifically by the Mapper subsystem
* within the Plugin component.
*/
-interface MapperExceptionInterface extends ExceptionInterface {}
+interface MapperExceptionInterface extends ExceptionInterface { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Plugin/Exception/PluginException.php
+++ b/core/lib/Drupal/Component/Plugin/Exception/PluginException.php
@@ -6,4 +6,4 @@
* Generic Plugin exception class to be thrown when no more specific class
* is applicable.
*/
-class PluginException extends \Exception implements ExceptionInterface {}
+class PluginException extends \Exception implements ExceptionInterface { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Utility/NestedArray.php
+++ b/core/lib/Drupal/Component/Utility/NestedArray.php
@@ -328,7 +328,7 @@ public static function mergeDeepArray(array $arrays, $preserve_integer_keys = FA
// Renumber integer keys as array_merge_recursive() does unless
// $preserve_integer_keys is set to TRUE. Note that PHP automatically
// converts array keys that are integer strings (e.g., '1') to integers.
- if (is_int($key) && !$preserve_integer_keys) {
+ if (is_integer($key) && !$preserve_integer_keys) {
$result[] = $value;
}
// Recurse when both values are arrays.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Utility/Number.php
+++ b/core/lib/Drupal/Component/Utility/Number.php
@@ -50,7 +50,7 @@ public static function validStep($value, $step, $offset = 0.0) {
// can't be represented with single precision floats are acceptable. The
// fractional part of a float has 24 bits. That means remainders smaller than
// $step * 2^-24 are acceptable.
- $computed_acceptable_error = (double) ($step / pow(2.0, 24));
+ $computed_acceptable_error = (double)($step / pow(2.0, 24));
return $computed_acceptable_error >= $remainder || $remainder >= ($step - $computed_acceptable_error);
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Utility/Random.php
+++ b/core/lib/Drupal/Component/Utility/Random.php
@@ -143,9 +143,7 @@ public function word($length) {
$vowels = ["a", "e", "i", "o", "u"];
$cons = ["b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "u", "v", "w", "tr",
- "cr", "br", "fr", "th", "dr", "ch", "ph", "wr", "st", "sp", "sw", "pr",
- "sl", "cl", "sh",
- ];
+ "cr", "br", "fr", "th", "dr", "ch", "ph", "wr", "st", "sp", "sw", "pr", "sl", "cl", "sh"];
$num_vowels = count($vowels);
$num_cons = count($cons);
@@ -221,8 +219,7 @@ public function sentences($min_word_count, $capitalize = FALSE) {
"utrum", "uxor", "valde", "valetudo", "validus", "vel", "velit",
"veniam", "venio", "vereor", "vero", "verto", "vicis", "vindico",
"virtus", "voco", "volutpat", "vulpes", "vulputate", "wisi", "ymo",
- "zelus",
- ];
+ "zelus"];
$dictionary_flipped = array_flip($dictionary);
$greeking = '';
only in patch2:
unchanged:
--- a/core/lib/Drupal/Component/Utility/UrlHelper.php
+++ b/core/lib/Drupal/Component/Utility/UrlHelper.php
@@ -148,11 +148,6 @@ public static function parse($url) {
$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 the fragment, if any.
- if (strpos($url, '#') !== FALSE) {
- list($url, $options['fragment']) = explode('#', $url, 2);
- }
-
// Split off everything before the query string into 'path'.
$parts = explode('?', $url);
@@ -163,7 +158,12 @@ public static function parse($url) {
}
// If there is a query string, transform it into keyed query parameters.
if (isset($parts[1])) {
- parse_str($parts[1], $options['query']);
+ $query_parts = explode('#', $parts[1]);
+ parse_str($query_parts[0], $options['query']);
+ // Take over the fragment, if there is any.
+ if (isset($query_parts[1])) {
+ $options['fragment'] = $query_parts[1];
+ }
}
}
// Internal URLs.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Block/MessagesBlockPluginInterface.php
+++ b/core/lib/Drupal/Core/Block/MessagesBlockPluginInterface.php
@@ -12,4 +12,4 @@
*
* @ingroup block_api
*/
-interface MessagesBlockPluginInterface extends BlockPluginInterface {}
+interface MessagesBlockPluginInterface extends BlockPluginInterface { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Config/ConfigManager.php
+++ b/core/lib/Drupal/Core/Config/ConfigManager.php
@@ -452,9 +452,7 @@ protected function callOnDependencyRemoval(ConfigEntityInterface $entity, array
// Key the entity arrays by config dependency name to make searching easy.
foreach (['config', 'content'] as $dependency_type) {
$affected_dependencies[$dependency_type] = array_combine(
- array_map(function ($entity) {
- return $entity->getConfigDependencyName();
- }, $affected_dependencies[$dependency_type]),
+ array_map(function ($entity) { return $entity->getConfigDependencyName(); }, $affected_dependencies[$dependency_type]),
$affected_dependencies[$dependency_type]
);
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Config/DatabaseStorage.php
+++ b/core/lib/Drupal/Core/Config/DatabaseStorage.php
@@ -318,8 +318,7 @@ public function getCollectionName() {
public function getAllCollectionNames() {
try {
return $this->connection->query('SELECT DISTINCT collection FROM {' . $this->connection->escapeTable($this->table) . '} WHERE collection <> :collection ORDER by collection', [
- ':collection' => StorageInterface::DEFAULT_COLLECTION,
- ]
+ ':collection' => StorageInterface::DEFAULT_COLLECTION]
)->fetchCol();
}
catch (\Exception $e) {
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
@@ -317,13 +317,6 @@ protected function has($id, EntityInterface $entity) {
}
/**
- * {@inheritdoc}
- */
- public function hasData() {
- return (bool) $this->configFactory->listAll($this->getPrefix());
- }
-
- /**
* Gets entities from the static cache.
*
* @param array $ids
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -187,7 +187,7 @@ public function __construct(\PDO $connection, array $connection_options) {
* @return \PDO
* A \PDO object.
*/
- public static function open(array &$connection_options = []) {}
+ public static function open(array &$connection_options = []) { }
/**
* Destroys this Connection object.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Delete.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Delete.php
@@ -7,4 +7,4 @@
/**
* MySQL implementation of \Drupal\Core\Database\Query\Delete.
*/
-class Delete extends QueryDelete {}
+class Delete extends QueryDelete { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Merge.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Merge.php
@@ -7,4 +7,4 @@
/**
* MySQL implementation of \Drupal\Core\Database\Query\Merge.
*/
-class Merge extends QueryMerge {}
+class Merge extends QueryMerge { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
@@ -226,9 +226,6 @@ protected function processField($field) {
return $field;
}
- /**
- * {@inheritdoc}
- */
public function getFieldTypeMap() {
// Put :normal last so it gets preserved by array_flip. This makes
// it much easier for modules (such as schema.module) to map
@@ -369,9 +366,6 @@ protected function createKeySql($fields) {
return implode(', ', $return);
}
- /**
- * {@inheritdoc}
- */
public function renameTable($table, $new_name) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", ['@table' => $table, '@table_new' => $new_name]));
@@ -384,9 +378,6 @@ public function renameTable($table, $new_name) {
return $this->connection->query('ALTER TABLE {' . $table . '} RENAME TO `' . $info['table'] . '`');
}
- /**
- * {@inheritdoc}
- */
public function dropTable($table) {
if (!$this->tableExists($table)) {
return FALSE;
@@ -396,9 +387,6 @@ public function dropTable($table) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function addField($table, $field, $spec, $keys_new = []) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", ['@field' => $field, '@table' => $table]));
@@ -444,9 +432,6 @@ public function addField($table, $field, $spec, $keys_new = []) {
}
}
- /**
- * {@inheritdoc}
- */
public function dropField($table, $field) {
if (!$this->fieldExists($table, $field)) {
return FALSE;
@@ -456,9 +441,6 @@ public function dropField($table, $field) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function fieldSetDefault($table, $field, $default) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", ['@table' => $table, '@field' => $field]));
@@ -467,9 +449,6 @@ public function fieldSetDefault($table, $field, $default) {
$this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` SET DEFAULT ' . $this->escapeDefaultValue($default));
}
- /**
- * {@inheritdoc}
- */
public function fieldSetNoDefault($table, $field) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", ['@table' => $table, '@field' => $field]));
@@ -478,9 +457,6 @@ public function fieldSetNoDefault($table, $field) {
$this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN `' . $field . '` DROP DEFAULT');
}
- /**
- * {@inheritdoc}
- */
public function indexExists($table, $name) {
// Returns one row for each column in the index. Result is string or FALSE.
// Details at http://dev.mysql.com/doc/refman/5.0/en/show-index.html
@@ -488,9 +464,6 @@ public function indexExists($table, $name) {
return isset($row['Key_name']);
}
- /**
- * {@inheritdoc}
- */
public function addPrimaryKey($table, $fields) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", ['@table' => $table]));
@@ -502,9 +475,6 @@ public function addPrimaryKey($table, $fields) {
$this->connection->query('ALTER TABLE {' . $table . '} ADD PRIMARY KEY (' . $this->createKeySql($fields) . ')');
}
- /**
- * {@inheritdoc}
- */
public function dropPrimaryKey($table) {
if (!$this->indexExists($table, 'PRIMARY')) {
return FALSE;
@@ -514,9 +484,6 @@ public function dropPrimaryKey($table) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function addUniqueKey($table, $name, $fields) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", ['@table' => $table, '@name' => $name]));
@@ -528,9 +495,6 @@ public function addUniqueKey($table, $name, $fields) {
$this->connection->query('ALTER TABLE {' . $table . '} ADD UNIQUE KEY `' . $name . '` (' . $this->createKeySql($fields) . ')');
}
- /**
- * {@inheritdoc}
- */
public function dropUniqueKey($table, $name) {
if (!$this->indexExists($table, $name)) {
return FALSE;
@@ -557,9 +521,6 @@ public function addIndex($table, $name, $fields, array $spec) {
$this->connection->query('ALTER TABLE {' . $table . '} ADD INDEX `' . $name . '` (' . $this->createKeySql($indexes[$name]) . ')');
}
- /**
- * {@inheritdoc}
- */
public function dropIndex($table, $name) {
if (!$this->indexExists($table, $name)) {
return FALSE;
@@ -569,9 +530,6 @@ public function dropIndex($table, $name) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function changeField($table, $field, $field_new, $spec, $keys_new = []) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", ['@table' => $table, '@name' => $field]));
@@ -587,9 +545,6 @@ public function changeField($table, $field, $field_new, $spec, $keys_new = []) {
$this->connection->query($sql);
}
- /**
- * {@inheritdoc}
- */
public function prepareComment($comment, $length = NULL) {
// Truncate comment to maximum comment length.
if (isset($length)) {
@@ -619,9 +574,6 @@ public function getComment($table, $column = NULL) {
return preg_replace('/; InnoDB free:.*$/', '', $comment);
}
- /**
- * {@inheritdoc}
- */
public function tableExists($table) {
// The information_schema table is very slow to query under MySQL 5.0.
// Instead, we try to select from the table in question. If it fails,
@@ -639,9 +591,6 @@ public function tableExists($table) {
}
}
- /**
- * {@inheritdoc}
- */
public function fieldExists($table, $column) {
// The information_schema table is very slow to query under MySQL 5.0.
// Instead, we try to select from the table and field in question. If it
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Select.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Select.php
@@ -7,4 +7,4 @@
/**
* MySQL implementation of \Drupal\Core\Database\Query\Select.
*/
-class Select extends QuerySelect {}
+class Select extends QuerySelect { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php
@@ -7,4 +7,4 @@
/**
* MySQL implementation of \Drupal\Core\Database\Transaction.
*/
-class Transaction extends DatabaseTransaction {}
+class Transaction extends DatabaseTransaction { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Truncate.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Truncate.php
@@ -7,4 +7,4 @@
/**
* MySQL implementation of \Drupal\Core\Database\Query\Truncate.
*/
-class Truncate extends QueryTruncate {}
+class Truncate extends QueryTruncate { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Update.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Update.php
@@ -7,4 +7,4 @@
/**
* MySQL implementation of \Drupal\Core\Database\Query\Update.
*/
-class Update extends QueryUpdate {}
+class Update extends QueryUpdate { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
@@ -54,21 +54,20 @@ class Connection extends DatabaseConnection {
* @see http://www.postgresql.org/docs/9.4/static/sql-keywords-appendix.html
*/
protected $postgresqlReservedKeyWords = ['all', 'analyse', 'analyze', 'and',
- 'any', 'array', 'as', 'asc', 'asymmetric', 'authorization', 'binary', 'both',
- 'case', 'cast', 'check', 'collate', 'collation', 'column', 'concurrently',
- 'constraint', 'create', 'cross', 'current_catalog', 'current_date',
- 'current_role', 'current_schema', 'current_time', 'current_timestamp',
- 'current_user', 'default', 'deferrable', 'desc', 'distinct', 'do', 'else',
- 'end', 'except', 'false', 'fetch', 'for', 'foreign', 'freeze', 'from', 'full',
- 'grant', 'group', 'having', 'ilike', 'in', 'initially', 'inner', 'intersect',
- 'into', 'is', 'isnull', 'join', 'lateral', 'leading', 'left', 'like', 'limit',
- 'localtime', 'localtimestamp', 'natural', 'not', 'notnull', 'null', 'offset',
- 'on', 'only', 'or', 'order', 'outer', 'over', 'overlaps', 'placing',
- 'primary', 'references', 'returning', 'right', 'select', 'session_user',
- 'similar', 'some', 'symmetric', 'table', 'then', 'to', 'trailing', 'true',
- 'union', 'unique', 'user', 'using', 'variadic', 'verbose', 'when', 'where',
- 'window', 'with',
- ];
+ 'any', 'array', 'as', 'asc', 'asymmetric', 'authorization', 'binary', 'both',
+ 'case', 'cast', 'check', 'collate', 'collation', 'column', 'concurrently',
+ 'constraint', 'create', 'cross', 'current_catalog', 'current_date',
+ 'current_role', 'current_schema', 'current_time', 'current_timestamp',
+ 'current_user', 'default', 'deferrable', 'desc', 'distinct', 'do', 'else',
+ 'end', 'except', 'false', 'fetch', 'for', 'foreign', 'freeze', 'from', 'full',
+ 'grant', 'group', 'having', 'ilike', 'in', 'initially', 'inner', 'intersect',
+ 'into', 'is', 'isnull', 'join', 'lateral', 'leading', 'left', 'like', 'limit',
+ 'localtime', 'localtimestamp', 'natural', 'not', 'notnull', 'null', 'offset',
+ 'on', 'only', 'or', 'order', 'outer', 'over', 'overlaps', 'placing',
+ 'primary', 'references', 'returning', 'right', 'select', 'session_user',
+ 'similar', 'some', 'symmetric', 'table', 'then', 'to', 'trailing', 'true',
+ 'union', 'unique', 'user', 'using', 'variadic', 'verbose', 'when', 'where',
+ 'window', 'with'];
/**
* Constructs a connection object.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php
@@ -66,7 +66,7 @@ public function execute() {
// used twice. However, trying to insert a value into a serial
// column should only be done in very rare cases and is not thread
// safe by definition.
- $this->connection->query("SELECT setval('" . $table_information->sequences[$index] . "', GREATEST(MAX(" . $serial_field . "), :serial_value)) FROM {" . $this->table . "}", [':serial_value' => (int) $serial_value]);
+ $this->connection->query("SELECT setval('" . $table_information->sequences[$index] . "', GREATEST(MAX(" . $serial_field . "), :serial_value)) FROM {" . $this->table . "}", [':serial_value' => (int)$serial_value]);
}
}
}
@@ -128,9 +128,7 @@ public function __toString() {
// Default fields are always placed first for consistency.
$insert_fields = array_merge($this->defaultFields, $this->insertFields);
- $insert_fields = array_map(function($f) {
- return $this->connection->escapeField($f);
- }, $insert_fields);
+ $insert_fields = array_map(function($f) { return $this->connection->escapeField($f); }, $insert_fields);
// If we're selecting from a SelectQuery, finish building the query and
// pass it back, as any remaining options are irrelevant.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
@@ -254,7 +254,7 @@ public function initializeDatabase() {
\'SELECT random();\'
LANGUAGE \'sql\'',
[],
- ['allow_delimiter_in_query' => TRUE ]
+ [ 'allow_delimiter_in_query' => TRUE ]
);
}
@@ -263,7 +263,7 @@ public function initializeDatabase() {
\'SELECT array_to_string((string_to_array($1, $2)) [1:$3], $2);\'
LANGUAGE \'sql\'',
[],
- ['allow_delimiter_in_query' => TRUE ]
+ [ 'allow_delimiter_in_query' => TRUE ]
);
}
$connection->query('SELECT pg_advisory_unlock(1)');
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Merge.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Merge.php
@@ -7,4 +7,4 @@
/**
* PostgreSQL implementation of \Drupal\Core\Database\Query\Merge.
*/
-class Merge extends QueryMerge {}
+class Merge extends QueryMerge { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php
@@ -60,7 +60,7 @@ public function execute() {
// used twice. However, trying to insert a value into a serial
// column should only be done in very rare cases and is not thread
// safe by definition.
- $this->connection->query("SELECT setval('" . $table_information->sequences[$index] . "', GREATEST(MAX(" . $serial_field . "), :serial_value)) FROM {" . $this->table . "}", [':serial_value' => (int) $serial_value]);
+ $this->connection->query("SELECT setval('" . $table_information->sequences[$index] . "', GREATEST(MAX(" . $serial_field . "), :serial_value)) FROM {" . $this->table . "}", [':serial_value' => (int)$serial_value]);
}
}
}
@@ -100,9 +100,7 @@ public function __toString() {
// Default fields are always placed first for consistency.
$insert_fields = array_merge($this->defaultFields, $this->insertFields);
- $insert_fields = array_map(function($f) {
- return $this->connection->escapeField($f);
- }, $insert_fields);
+ $insert_fields = array_map(function($f) { return $this->connection->escapeField($f); }, $insert_fields);
$query = $comments . 'INSERT INTO {' . $this->table . '} (' . implode(', ', $insert_fields) . ') VALUES ';
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
@@ -383,7 +383,8 @@ protected function processField($field) {
}
/**
- * {@inheritdoc}
+ * This maps a generic data type in combination with its data size
+ * to the engine-specific data type.
*/
public function getFieldTypeMap() {
// Put :normal last so it gets preserved by array_flip. This makes
@@ -470,9 +471,6 @@ public function tableExists($table) {
return (bool) $this->connection->query("SELECT 1 FROM pg_tables WHERE schemaname = :schema AND tablename = :table", [':schema' => $prefixInfo['schema'], ':table' => $prefixInfo['table']])->fetchField();
}
- /**
- * {@inheritdoc}
- */
public function renameTable($table, $new_name) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", ['@table' => $table, '@table_new' => $new_name]));
@@ -527,9 +525,6 @@ public function renameTable($table, $new_name) {
$this->resetTableInformation($table);
}
- /**
- * {@inheritdoc}
- */
public function dropTable($table) {
if (!$this->tableExists($table)) {
return FALSE;
@@ -540,9 +535,6 @@ public function dropTable($table) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function addField($table, $field, $spec, $new_keys = []) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", ['@field' => $field, '@table' => $table]));
@@ -591,9 +583,6 @@ public function addField($table, $field, $spec, $new_keys = []) {
$this->resetTableInformation($table);
}
- /**
- * {@inheritdoc}
- */
public function dropField($table, $field) {
if (!$this->fieldExists($table, $field)) {
return FALSE;
@@ -604,9 +593,6 @@ public function dropField($table, $field) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function fieldSetDefault($table, $field, $default) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", ['@table' => $table, '@field' => $field]));
@@ -617,9 +603,6 @@ public function fieldSetDefault($table, $field, $default) {
$this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" SET DEFAULT ' . $default);
}
- /**
- * {@inheritdoc}
- */
public function fieldSetNoDefault($table, $field) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", ['@table' => $table, '@field' => $field]));
@@ -628,9 +611,6 @@ public function fieldSetNoDefault($table, $field) {
$this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" DROP DEFAULT');
}
- /**
- * {@inheritdoc}
- */
public function indexExists($table, $name) {
// Details http://www.postgresql.org/docs/9.1/interactive/view-pg-indexes.html
$index_name = $this->ensureIdentifiersLength($table, $name, 'idx');
@@ -671,9 +651,6 @@ public function constraintExists($table, $name) {
return (bool) $this->connection->query("SELECT 1 FROM pg_constraint WHERE conname = '$constraint_name'")->fetchField();
}
- /**
- * {@inheritdoc}
- */
public function addPrimaryKey($table, $fields) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", ['@table' => $table]));
@@ -686,9 +663,6 @@ public function addPrimaryKey($table, $fields) {
$this->resetTableInformation($table);
}
- /**
- * {@inheritdoc}
- */
public function dropPrimaryKey($table) {
if (!$this->constraintExists($table, 'pkey')) {
return FALSE;
@@ -699,9 +673,6 @@ public function dropPrimaryKey($table) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function addUniqueKey($table, $name, $fields) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", ['@table' => $table, '@name' => $name]));
@@ -714,9 +685,6 @@ public function addUniqueKey($table, $name, $fields) {
$this->resetTableInformation($table);
}
- /**
- * {@inheritdoc}
- */
public function dropUniqueKey($table, $name) {
if (!$this->constraintExists($table, $name . '__key')) {
return FALSE;
@@ -742,9 +710,6 @@ public function addIndex($table, $name, $fields, array $spec) {
$this->resetTableInformation($table);
}
- /**
- * {@inheritdoc}
- */
public function dropIndex($table, $name) {
if (!$this->indexExists($table, $name)) {
return FALSE;
@@ -755,9 +720,6 @@ public function dropIndex($table, $name) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function changeField($table, $field, $field_new, $spec, $new_keys = []) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", ['@table' => $table, '@name' => $field]));
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Transaction.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Transaction.php
@@ -7,4 +7,4 @@
/**
* PostgreSQL implementation of \Drupal\Core\Database\Transaction.
*/
-class Transaction extends DatabaseTransaction {}
+class Transaction extends DatabaseTransaction { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php
@@ -7,4 +7,4 @@
/**
* SQLite implementation of \Drupal\Core\Database\Query\Delete.
*/
-class Delete extends QueryDelete {}
+class Delete extends QueryDelete { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php
@@ -7,4 +7,4 @@
/**
* SQLite implementation of \Drupal\Core\Database\Query\Merge.
*/
-class Merge extends QueryMerge {}
+class Merge extends QueryMerge { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
@@ -22,9 +22,6 @@ class Schema extends DatabaseSchema {
*/
protected $defaultSchema = 'main';
- /**
- * {@inheritdoc}
- */
public function tableExists($table) {
$info = $this->getPrefixInfo($table);
@@ -32,9 +29,6 @@ public function tableExists($table) {
return (bool) $this->connection->query('SELECT 1 FROM ' . $info['schema'] . '.sqlite_master WHERE type = :type AND name = :name', [':type' => 'table', ':name' => $info['table']])->fetchField();
}
- /**
- * {@inheritdoc}
- */
public function fieldExists($table, $column) {
$schema = $this->introspectSchema($table);
return !empty($schema['fields'][$column]);
@@ -207,7 +201,8 @@ protected function createFieldSql($name, $spec) {
}
/**
- * {@inheritdoc}
+ * This maps a generic data type in combination with its data size
+ * to the engine-specific data type.
*/
public function getFieldTypeMap() {
// Put :normal last so it gets preserved by array_flip. This makes
@@ -252,9 +247,6 @@ public function getFieldTypeMap() {
return $map;
}
- /**
- * {@inheritdoc}
- */
public function renameTable($table, $new_name) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot rename @table to @table_new: table @table doesn't exist.", ['@table' => $table, '@table_new' => $new_name]));
@@ -292,9 +284,6 @@ public function renameTable($table, $new_name) {
}
}
- /**
- * {@inheritdoc}
- */
public function dropTable($table) {
if (!$this->tableExists($table)) {
return FALSE;
@@ -304,9 +293,6 @@ public function dropTable($table) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function addField($table, $field, $specification, $keys_new = []) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add field @table.@field: table doesn't exist.", ['@field' => $field, '@table' => $table]));
@@ -514,9 +500,6 @@ protected function introspectSchema($table) {
return $schema;
}
- /**
- * {@inheritdoc}
- */
public function dropField($table, $field) {
if (!$this->fieldExists($table, $field)) {
return FALSE;
@@ -548,9 +531,6 @@ public function dropField($table, $field) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function changeField($table, $field, $field_new, $spec, $keys_new = []) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot change the definition of field @table.@name: field doesn't exist.", ['@table' => $table, '@name' => $field]));
@@ -634,18 +614,12 @@ public function addIndex($table, $name, $fields, array $spec) {
}
}
- /**
- * {@inheritdoc}
- */
public function indexExists($table, $name) {
$info = $this->getPrefixInfo($table);
return $this->connection->query('PRAGMA ' . $info['schema'] . '.index_info(' . $info['table'] . '_' . $name . ')')->fetchField() != '';
}
- /**
- * {@inheritdoc}
- */
public function dropIndex($table, $name) {
if (!$this->indexExists($table, $name)) {
return FALSE;
@@ -657,9 +631,6 @@ public function dropIndex($table, $name) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function addUniqueKey($table, $name, $fields) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add unique key @name to table @table: table doesn't exist.", ['@table' => $table, '@name' => $name]));
@@ -675,9 +646,6 @@ public function addUniqueKey($table, $name, $fields) {
}
}
- /**
- * {@inheritdoc}
- */
public function dropUniqueKey($table, $name) {
if (!$this->indexExists($table, $name)) {
return FALSE;
@@ -689,9 +657,6 @@ public function dropUniqueKey($table, $name) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function addPrimaryKey($table, $fields) {
if (!$this->tableExists($table)) {
throw new SchemaObjectDoesNotExistException(t("Cannot add primary key to table @table: table doesn't exist.", ['@table' => $table]));
@@ -708,9 +673,6 @@ public function addPrimaryKey($table, $fields) {
$this->alterTable($table, $old_schema, $new_schema);
}
- /**
- * {@inheritdoc}
- */
public function dropPrimaryKey($table) {
$old_schema = $this->introspectSchema($table);
$new_schema = $old_schema;
@@ -724,9 +686,6 @@ public function dropPrimaryKey($table) {
return TRUE;
}
- /**
- * {@inheritdoc}
- */
public function fieldSetDefault($table, $field, $default) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot set default value of field @table.@field: field doesn't exist.", ['@table' => $table, '@field' => $field]));
@@ -739,9 +698,6 @@ public function fieldSetDefault($table, $field, $default) {
$this->alterTable($table, $old_schema, $new_schema);
}
- /**
- * {@inheritdoc}
- */
public function fieldSetNoDefault($table, $field) {
if (!$this->fieldExists($table, $field)) {
throw new SchemaObjectDoesNotExistException(t("Cannot remove default value of field @table.@field: field doesn't exist.", ['@table' => $table, '@field' => $field]));
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php
@@ -7,4 +7,4 @@
/**
* SQLite implementation of \Drupal\Core\Database\Transaction.
*/
-class Transaction extends DatabaseTransaction {}
+class Transaction extends DatabaseTransaction { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Update.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Update.php
@@ -7,4 +7,4 @@
/**
* SQLite implementation of \Drupal\Core\Database\Query\Update.
*/
-class Update extends QueryUpdate {}
+class Update extends QueryUpdate { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/IntegrityConstraintViolationException.php
+++ b/core/lib/Drupal/Core/Database/IntegrityConstraintViolationException.php
@@ -8,4 +8,4 @@
* This exception is thrown e.g. when trying to insert a row that would violate
* a unique key constraint.
*/
-class IntegrityConstraintViolationException extends \RuntimeException implements DatabaseException {}
+class IntegrityConstraintViolationException extends \RuntimeException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/InvalidQueryException.php
+++ b/core/lib/Drupal/Core/Database/InvalidQueryException.php
@@ -8,4 +8,4 @@
* This exception is thrown e.g. when trying to have an IN condition with an
* empty array.
*/
-class InvalidQueryException extends \InvalidArgumentException implements DatabaseException {}
+class InvalidQueryException extends \InvalidArgumentException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -156,14 +156,14 @@ public function hasTag($tag) {
* {@inheritdoc}
*/
public function hasAllTags() {
- return !(boolean) array_diff(func_get_args(), array_keys($this->alterTags));
+ return !(boolean)array_diff(func_get_args(), array_keys($this->alterTags));
}
/**
* {@inheritdoc}
*/
public function hasAnyTag() {
- return (boolean) array_intersect(func_get_args(), array_keys($this->alterTags));
+ return (boolean)array_intersect(func_get_args(), array_keys($this->alterTags));
}
/**
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/SchemaException.php
+++ b/core/lib/Drupal/Core/Database/SchemaException.php
@@ -5,4 +5,4 @@
/**
* Base exception for Schema-related errors.
*/
-class SchemaException extends \RuntimeException implements DatabaseException {}
+class SchemaException extends \RuntimeException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/SchemaObjectDoesNotExistException.php
+++ b/core/lib/Drupal/Core/Database/SchemaObjectDoesNotExistException.php
@@ -9,4 +9,4 @@
* modify a database table, field, or index that does not currently exist in
* the database schema.
*/
-class SchemaObjectDoesNotExistException extends SchemaException implements DatabaseException {}
+class SchemaObjectDoesNotExistException extends SchemaException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/SchemaObjectExistsException.php
+++ b/core/lib/Drupal/Core/Database/SchemaObjectExistsException.php
@@ -9,4 +9,4 @@
* create a new database table, field, or index that already exists in the
* database schema.
*/
-class SchemaObjectExistsException extends SchemaException implements DatabaseException {}
+class SchemaObjectExistsException extends SchemaException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/TransactionCommitFailedException.php
+++ b/core/lib/Drupal/Core/Database/TransactionCommitFailedException.php
@@ -5,4 +5,4 @@
/**
* Exception thrown when a commit() function fails.
*/
-class TransactionCommitFailedException extends TransactionException implements DatabaseException {}
+class TransactionCommitFailedException extends TransactionException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/TransactionException.php
+++ b/core/lib/Drupal/Core/Database/TransactionException.php
@@ -5,4 +5,4 @@
/**
* Exception thrown by an error in a database transaction.
*/
-class TransactionException extends \RuntimeException implements DatabaseException {}
+class TransactionException extends \RuntimeException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/TransactionExplicitCommitNotAllowedException.php
+++ b/core/lib/Drupal/Core/Database/TransactionExplicitCommitNotAllowedException.php
@@ -8,4 +8,4 @@
* This exception will be thrown when the PDO connection commit() is called.
* Code should never call this method directly.
*/
-class TransactionExplicitCommitNotAllowedException extends TransactionException implements DatabaseException {}
+class TransactionExplicitCommitNotAllowedException extends TransactionException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/TransactionNameNonUniqueException.php
+++ b/core/lib/Drupal/Core/Database/TransactionNameNonUniqueException.php
@@ -5,4 +5,4 @@
/**
* Exception thrown when a savepoint or transaction name occurs twice.
*/
-class TransactionNameNonUniqueException extends TransactionException implements DatabaseException {}
+class TransactionNameNonUniqueException extends TransactionException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/TransactionNoActiveException.php
+++ b/core/lib/Drupal/Core/Database/TransactionNoActiveException.php
@@ -5,4 +5,4 @@
/**
* Exception for when popTransaction() is called with no active transaction.
*/
-class TransactionNoActiveException extends TransactionException implements DatabaseException {}
+class TransactionNoActiveException extends TransactionException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Database/TransactionOutOfOrderException.php
+++ b/core/lib/Drupal/Core/Database/TransactionOutOfOrderException.php
@@ -5,4 +5,4 @@
/**
* Exception thrown when a rollBack() resulted in other active transactions being rolled-back.
*/
-class TransactionOutOfOrderException extends TransactionException implements DatabaseException {}
+class TransactionOutOfOrderException extends TransactionException implements DatabaseException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Diff/DiffFormatter.php
+++ b/core/lib/Drupal/Core/Diff/DiffFormatter.php
@@ -192,7 +192,7 @@ protected function _changed($orig, $closing) {
// Notice that WordLevelDiff returns HTML-escaped output. Hence, we will be
// calling addedLine/deletedLine without HTML-escaping.
while ($line = array_shift($del)) {
- $aline = array_shift($add );
+ $aline = array_shift( $add );
$this->rows[] = array_merge($this->deletedLine($line), isset($aline) ? $this->addedLine($aline) : $this->emptyLine());
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php
@@ -916,9 +916,7 @@ public function getTranslationStatus($langcode) {
* {@inheritdoc}
*/
public function getTranslationLanguages($include_default = TRUE) {
- $translations = array_filter($this->translations, function($translation) {
- return $translation['status'];
- });
+ $translations = array_filter($this->translations, function($translation) { return $translation['status']; });
unset($translations[LanguageInterface::LANGCODE_DEFAULT]);
if ($include_default) {
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/ContentEntityForm.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityForm.php
@@ -127,15 +127,6 @@ public function form(array $form, FormStateInterface $form_state) {
$this->addRevisionableFormFields($form);
}
- $form['footer'] = [
- '#type' => 'container',
- '#weight' => 99,
- '#attributes' => [
- 'class' => ['entity-content-form-footer']
- ],
- '#optional' => TRUE,
- ];
-
return $form;
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
@@ -65,6 +65,16 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
/**
* {@inheritdoc}
*/
+ public function hasData() {
+ return (bool) $this->getQuery()
+ ->accessCheck(FALSE)
+ ->range(0, 1)
+ ->execute();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
protected function doCreate(array $values) {
// We have to determine the bundle first.
$bundle = FALSE;
@@ -80,40 +90,6 @@ protected function doCreate(array $values) {
}
/**
- * {@inheritdoc}
- */
- public function createWithSampleValues($bundle = FALSE, array $values = []) {
- // ID and revision should never have sample values generated for them.
- $forbidden_keys = [
- $this->entityType->getKey('id'),
- ];
- if ($revision_key = $this->entityType->getKey('revision')) {
- $forbidden_keys[] = $revision_key;
- }
- if ($bundle_key = $this->entityType->getKey('bundle')) {
- if (!$bundle) {
- throw new EntityStorageException("No entity bundle was specified");
- }
- if (!array_key_exists($bundle, $this->entityManager->getBundleInfo($this->entityTypeId))) {
- throw new EntityStorageException(sprintf("Missing entity bundle. The \"%s\" bundle does not exist", $bundle));
- }
- $values[$bundle_key] = $bundle;
- // Bundle is already set
- $forbidden_keys[] = $bundle_key;
- }
- // Forbid sample generation on any keys whose values were submitted.
- $forbidden_keys = array_merge($forbidden_keys, array_keys($values));
- /** @var \Drupal\Core\Entity\FieldableEntityInterface $entity */
- $entity = $this->create($values);
- foreach ($entity as $field_name => $value) {
- if (!in_array($field_name, $forbidden_keys, TRUE)) {
- $entity->get($field_name)->generateSampleItems();
- }
- }
- return $entity;
- }
-
- /**
* Initializes field values.
*
* @param \Drupal\Core\Entity\ContentEntityInterface $entity
@@ -153,12 +129,8 @@ protected function initFieldValues(ContentEntityInterface $entity, array $values
*/
public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []) {
$translation = $entity->getTranslation($langcode);
- $definitions = array_filter($translation->getFieldDefinitions(), function(FieldDefinitionInterface $definition) {
- return $definition->isTranslatable();
- });
- $field_names = array_map(function(FieldDefinitionInterface $definition) {
- return $definition->getName();
- }, $definitions);
+ $definitions = array_filter($translation->getFieldDefinitions(), function(FieldDefinitionInterface $definition) { return $definition->isTranslatable(); });
+ $field_names = array_map(function(FieldDefinitionInterface $definition) { return $definition->getName(); }, $definitions);
$values[$this->langcodeKey] = $langcode;
$values[$this->getEntityType()->getKey('default_langcode')] = FALSE;
$this->initFieldValues($translation, $values, $field_names);
@@ -169,32 +141,32 @@ public function createTranslation(ContentEntityInterface $entity, $langcode, arr
/**
* {@inheritdoc}
*/
- public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {}
+ public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) { }
/**
* {@inheritdoc}
*/
- public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {}
+ public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) { }
/**
* {@inheritdoc}
*/
- public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) {}
+ public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) { }
/**
* {@inheritdoc}
*/
- public function onFieldDefinitionCreate(FieldDefinitionInterface $field_definition) {}
+ public function onFieldDefinitionCreate(FieldDefinitionInterface $field_definition) { }
/**
* {@inheritdoc}
*/
- public function onFieldDefinitionUpdate(FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original) {}
+ public function onFieldDefinitionUpdate(FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original) { }
/**
* {@inheritdoc}
*/
- public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definition) {}
+ public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definition) { }
/**
* {@inheritdoc}
@@ -238,7 +210,7 @@ public function purgeFieldData(FieldDefinitionInterface $field_definition, $batc
/**
* {@inheritdoc}
*/
- public function finalizePurge(FieldStorageDefinitionInterface $storage_definition) {}
+ public function finalizePurge(FieldStorageDefinitionInterface $storage_definition) { }
/**
* {@inheritdoc}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/ContentEntityStorageInterface.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageInterface.php
@@ -23,21 +23,4 @@
*/
public function createTranslation(ContentEntityInterface $entity, $langcode, array $values = []);
-
- /**
- * Creates an entity with sample field values.
- *
- * @param string|bool $bundle
- * (optional) The entity bundle.
- * @param array $values
- * (optional) Any default values to use during generation.
- *
- * @return \Drupal\Core\Entity\FieldableEntityInterface
- * A fieldable content entity.
- *
- * @throws \Drupal\Core\Entity\EntityStorageException
- * Thrown if the bundle does not exist or was needed but not specified.
- */
- public function createWithSampleValues($bundle = FALSE, array $values = []);
-
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/DynamicallyFieldableEntityStorageInterface.php
+++ b/core/lib/Drupal/Core/Entity/DynamicallyFieldableEntityStorageInterface.php
@@ -19,6 +19,14 @@
interface DynamicallyFieldableEntityStorageInterface extends FieldableEntityStorageInterface, FieldStorageDefinitionListenerInterface, FieldDefinitionListenerInterface {
/**
+ * Determines if the storage contains any data.
+ *
+ * @return bool
+ * TRUE if the storage contains data, FALSE if not.
+ */
+ public function hasData();
+
+ /**
* Purges a batch of field data.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/EntityMalformedException.php
+++ b/core/lib/Drupal/Core/Entity/EntityMalformedException.php
@@ -5,4 +5,4 @@
/**
* Defines an exception thrown when a malformed entity is passed.
*/
-class EntityMalformedException extends \Exception {}
+class EntityMalformedException extends \Exception { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php
+++ b/core/lib/Drupal/Core/Entity/EntityPublishedTrait.php
@@ -32,13 +32,11 @@ public static function publishedBaseFieldDefinitions(EntityTypeInterface $entity
throw new UnsupportedEntityTypeDefinitionException('The entity type ' . $entity_type->id() . ' does not have a "published" entity key.');
}
- return [
- $entity_type->getKey('published') => BaseFieldDefinition::create('boolean')
- ->setLabel(new TranslatableMarkup('Published'))
- ->setRevisionable(TRUE)
- ->setTranslatable(TRUE)
- ->setDefaultValue(TRUE),
- ];
+ return [$entity_type->getKey('published') => BaseFieldDefinition::create('boolean')
+ ->setLabel(new TranslatableMarkup('Published'))
+ ->setRevisionable(TRUE)
+ ->setTranslatable(TRUE)
+ ->setDefaultValue(TRUE)];
}
/**
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php
@@ -81,17 +81,17 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
/**
* {@inheritdoc}
*/
- public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {}
+ public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { }
/**
* {@inheritdoc}
*/
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {}
+ public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { }
/**
* {@inheritdoc}
*/
- public function entityQueryAlter(SelectInterface $query) {}
+ public function entityQueryAlter(SelectInterface $query) { }
/**
* Moves the backward compatibility level configurations in the right place.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/EntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityStorageBase.php
@@ -508,16 +508,6 @@ public function loadByProperties(array $values = []) {
/**
* {@inheritdoc}
*/
- public function hasData() {
- return (bool) $this->getQuery()
- ->accessCheck(FALSE)
- ->range(0, 1)
- ->execute();
- }
-
- /**
- * {@inheritdoc}
- */
public function getQuery($conjunction = 'AND') {
// Access the service directly rather than entity.query factory so the
// storage's current entity type is used.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/EntityStorageException.php
+++ b/core/lib/Drupal/Core/Entity/EntityStorageException.php
@@ -5,4 +5,4 @@
/**
* Defines an exception thrown when storage operations fail.
*/
-class EntityStorageException extends \Exception {}
+class EntityStorageException extends \Exception { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php
@@ -143,14 +143,6 @@ public function delete(array $entities);
public function save(EntityInterface $entity);
/**
- * Determines if the storage contains any data.
- *
- * @return bool
- * TRUE if the storage contains data, FALSE if not.
- */
- public function hasData();
-
- /**
* Gets an entity query instance.
*
* @param string $conjunction
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -337,7 +337,7 @@ public function buildComponents(array &$build, array $entities, array $displays,
* @param string $view_mode
* The view mode that should be used to prepare the entity.
*/
- protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {}
+ protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) { }
/**
* {@inheritdoc}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Exception/EntityTypeIdLengthException.php
+++ b/core/lib/Drupal/Core/Entity/Exception/EntityTypeIdLengthException.php
@@ -5,4 +5,4 @@
/**
* Defines an exception thrown when an entity ID is too long.
*/
-class EntityTypeIdLengthException extends \Exception {}
+class EntityTypeIdLengthException extends \Exception { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Exception/UnsupportedEntityTypeDefinitionException.php
+++ b/core/lib/Drupal/Core/Entity/Exception/UnsupportedEntityTypeDefinitionException.php
@@ -5,4 +5,4 @@
/**
* Defines an exception thrown when an entity type definition is invalid.
*/
-class UnsupportedEntityTypeDefinitionException extends \Exception {}
+class UnsupportedEntityTypeDefinitionException extends \Exception { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueContentEntityStorage.php
+++ b/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueContentEntityStorage.php
@@ -18,9 +18,4 @@ public function createTranslation(ContentEntityInterface $entity, $langcode, arr
// https://www.drupal.org/node/2618436.
}
- /**
- * {@inheritdoc}
- */
- public function createWithSampleValues($bundle = FALSE, array $values = []) {}
-
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php
+++ b/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php
@@ -190,13 +190,6 @@ protected function has($id, EntityInterface $entity) {
/**
* {@inheritdoc}
*/
- public function hasData() {
- return (bool) $this->keyValueStore->getAll();
- }
-
- /**
- * {@inheritdoc}
- */
protected function getQueryServiceName() {
return 'entity.query.keyvalue';
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php
@@ -46,7 +46,7 @@ class EntityAdapter extends TypedData implements \IteratorAggregate, ComplexData
public static function createFromEntity(EntityInterface $entity) {
$definition = EntityDataDefinition::create()
->setEntityTypeId($entity->getEntityTypeId())
- ->setBundles([$entity->bundle() ]);
+ ->setBundles([ $entity->bundle() ]);
$instance = new static($definition);
$instance->setValue($entity);
return $instance;
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php
@@ -6,4 +6,4 @@
* @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
* Use \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection
*/
-class SelectionBase extends DefaultSelection {}
+class SelectionBase extends DefaultSelection { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php
@@ -121,29 +121,16 @@ public function validate($value, Constraint $constraint) {
// Add violations on deltas with a target_id that is not valid.
if ($target_ids) {
- // Get a list of pre-existing references.
- $previously_referenced_ids = [];
- if ($value->getParent() && ($entity = $value->getEntity()) && !$entity->isNew()) {
- $existing_entity = $this->entityTypeManager->getStorage($entity->getEntityTypeId())->loadUnchanged($entity->id());
- foreach ($existing_entity->{$value->getFieldDefinition()->getName()}->getValue() as $item) {
- $previously_referenced_ids[$item['target_id']] = $item['target_id'];
- }
- }
-
$valid_target_ids = $handler->validateReferenceableEntities($target_ids);
if ($invalid_target_ids = array_diff($target_ids, $valid_target_ids)) {
// For accuracy of the error message, differentiate non-referenceable
// and non-existent entities.
- $existing_entities = $this->entityTypeManager->getStorage($target_type_id)->loadMultiple($invalid_target_ids);
+ $target_type = $this->entityTypeManager->getDefinition($target_type_id);
+ $existing_ids = $this->entityTypeManager->getStorage($target_type_id)->getQuery()
+ ->condition($target_type->getKey('id'), $invalid_target_ids, 'IN')
+ ->execute();
foreach ($invalid_target_ids as $delta => $target_id) {
- // Check if any of the invalid existing references are simply not
- // accessible by the user, in which case they need to be excluded from
- // validation
- if (isset($previously_referenced_ids[$target_id]) && isset($existing_entities[$target_id]) && !$existing_entities[$target_id]->access('view')) {
- continue;
- }
-
- $message = isset($existing_entities[$target_id]) ? $constraint->message : $constraint->nonExistingMessage;
+ $message = in_array($target_id, $existing_ids) ? $constraint->message : $constraint->nonExistingMessage;
$this->context->buildViolation($message)
->setParameter('%type', $target_type_id)
->setParameter('%id', $target_id)
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Query/QueryBase.php
+++ b/core/lib/Drupal/Core/Entity/Query/QueryBase.php
@@ -348,14 +348,14 @@ public function hasTag($tag) {
* {@inheritdoc}
*/
public function hasAllTags() {
- return !(boolean) array_diff(func_get_args(), array_keys($this->alterTags));
+ return !(boolean)array_diff(func_get_args(), array_keys($this->alterTags));
}
/**
* {@inheritdoc}
*/
public function hasAnyTag() {
- return (boolean) array_intersect(func_get_args(), array_keys($this->alterTags));
+ return (boolean)array_intersect(func_get_args(), array_keys($this->alterTags));
}
/**
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Query/QueryException.php
+++ b/core/lib/Drupal/Core/Entity/Query/QueryException.php
@@ -9,4 +9,4 @@
* conditions, and will raise a QueryException when an unsupported
* condition was specified.
*/
-class QueryException extends \Exception {}
+class QueryException extends \Exception { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php
@@ -172,7 +172,7 @@ protected function result() {
}
$return = [];
foreach ($this->sqlQuery->execute() as $row) {
- $return[] = (array) $row;
+ $return[] = (array)$row;
}
return $return;
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
@@ -8,7 +8,6 @@
use Drupal\Core\Entity\Sql\SqlEntityStorageInterface;
use Drupal\Core\Entity\Sql\TableMappingInterface;
use Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface;
-use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\TypedData\DataReferenceDefinitionInterface;
/**
@@ -274,7 +273,7 @@ public function addField($field, $type, $langcode) {
$entity_type = $this->entityManager->getDefinition($entity_type_id);
$field_storage_definitions = $this->entityManager->getFieldStorageDefinitions($entity_type_id);
// Add the new entity base table using the table and sql column.
- $base_table = $this->addNextBaseTable($entity_type, $table, $sql_column, $field_storage);
+ $base_table = $this->addNextBaseTable($entity_type, $table, $sql_column);
$propertyDefinitions = [];
$key++;
$index_prefix .= "$next_index_prefix.";
@@ -396,13 +395,11 @@ protected function getTableMapping($table, $entity_type_id) {
* This is the table being joined, in the above example, {users}.
* @param string $sql_column
* This is the SQL column in the existing table being joined to.
- * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage
- * The field storage definition for the field referencing this column.
*
* @return string
* The alias of the next entity table joined in.
*/
- protected function addNextBaseTable(EntityType $entity_type, $table, $sql_column, FieldStorageDefinitionInterface $field_storage) {
+ protected function addNextBaseTable(EntityType $entity_type, $table, $sql_column) {
$join_condition = '%alias.' . $entity_type->getKey('id') . " = $table.$sql_column";
return $this->sqlQuery->leftJoin($entity_type->getBaseTable(), NULL, $join_condition);
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php
+++ b/core/lib/Drupal/Core/Entity/Sql/DefaultTableMapping.php
@@ -296,15 +296,9 @@ public function requiresDedicatedTableStorage(FieldStorageDefinitionInterface $s
*/
public function getDedicatedTableNames() {
$table_mapping = $this;
- $definitions = array_filter($this->fieldStorageDefinitions, function($definition) use ($table_mapping) {
- return $table_mapping->requiresDedicatedTableStorage($definition);
- });
- $data_tables = array_map(function($definition) use ($table_mapping) {
- return $table_mapping->getDedicatedDataTableName($definition);
- }, $definitions);
- $revision_tables = array_map(function($definition) use ($table_mapping) {
- return $table_mapping->getDedicatedRevisionTableName($definition);
- }, $definitions);
+ $definitions = array_filter($this->fieldStorageDefinitions, function($definition) use ($table_mapping) { return $table_mapping->requiresDedicatedTableStorage($definition); });
+ $data_tables = array_map(function($definition) use ($table_mapping) { return $table_mapping->getDedicatedDataTableName($definition); }, $definitions);
+ $revision_tables = array_map(function($definition) use ($table_mapping) { return $table_mapping->getDedicatedRevisionTableName($definition); }, $definitions);
$dedicated_tables = array_merge(array_values($data_tables), array_values($revision_tables));
return $dedicated_tables;
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
@@ -1540,12 +1540,12 @@ public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definiti
/**
* {@inheritdoc}
*/
- public function onBundleCreate($bundle, $entity_type_id) {}
+ public function onBundleCreate($bundle, $entity_type_id) { }
/**
* {@inheritdoc}
*/
- public function onBundleDelete($bundle, $entity_type_id) {}
+ public function onBundleDelete($bundle, $entity_type_id) { }
/**
* {@inheritdoc}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
@@ -1529,9 +1529,7 @@ protected function createEntitySchemaIndexes(array $entity_schema, FieldStorageD
// involving them. Only indexes for which all columns exist are
// actually created.
$create = FALSE;
- $specifier_columns = array_map(function($item) {
- return is_string($item) ? $item : reset($item);
- }, $specifier);
+ $specifier_columns = array_map(function($item) { return is_string($item) ? $item : reset($item); }, $specifier);
if (!isset($column_names) || array_intersect($specifier_columns, $column_names)) {
$create = TRUE;
foreach ($specifier_columns as $specifier_column_name) {
@@ -1580,9 +1578,7 @@ protected function deleteEntitySchemaIndexes(array $entity_schema_data, FieldSto
foreach ($index_keys as $key => $drop_method) {
if (!empty($schema[$key])) {
foreach ($schema[$key] as $name => $specifier) {
- $specifier_columns = array_map(function($item) {
- return is_string($item) ? $item : reset($item);
- }, $specifier);
+ $specifier_columns = array_map(function($item) { return is_string($item) ? $item : reset($item); }, $specifier);
if (!isset($column_names) || array_intersect($specifier_columns, $column_names)) {
$schema_handler->{$drop_method}($table_name, $name);
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php
+++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchemaConverter.php
@@ -346,9 +346,7 @@ protected function copyData(array &$sandbox) {
* An array of updated field storage definitions.
*/
protected function updateFieldStorageDefinitionsToRevisionable(ContentEntityTypeInterface $entity_type, array $storage_definitions, array $fields_to_update = [], $update_cached_definitions = TRUE) {
- $updated_storage_definitions = array_map(function ($storage_definition) {
- return clone $storage_definition;
- }, $storage_definitions);
+ $updated_storage_definitions = array_map(function ($storage_definition) { return clone $storage_definition; }, $storage_definitions);
// Update the 'langcode' field manually, as it is configured in the base
// content entity field definitions.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Extension/ExtensionNameLengthException.php
+++ b/core/lib/Drupal/Core/Extension/ExtensionNameLengthException.php
@@ -5,4 +5,4 @@
/**
* Exception thrown when the extension's name length exceeds the allowed maximum.
*/
-class ExtensionNameLengthException extends \Exception {}
+class ExtensionNameLengthException extends \Exception { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Extension/ModuleUninstallValidatorException.php
+++ b/core/lib/Drupal/Core/Extension/ModuleUninstallValidatorException.php
@@ -5,4 +5,4 @@
/**
* Defines an exception thrown when uninstalling a module that did not validate.
*/
-class ModuleUninstallValidatorException extends \InvalidArgumentException {}
+class ModuleUninstallValidatorException extends \InvalidArgumentException { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Extension/module.api.php
+++ b/core/lib/Drupal/Core/Extension/module.api.php
@@ -449,7 +449,8 @@ function hook_install_tasks(&$install_state) {
// tasks are complete, with a link to reload the current page and therefore
// pass on to the final Drupal installation tasks when the user is ready to
// do so).
- 'myprofile_final_site_setup' => [],
+ 'myprofile_final_site_setup' => [
+ ],
];
return $tasks;
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Field/FieldItemBase.php
+++ b/core/lib/Drupal/Core/Field/FieldItemBase.php
@@ -191,27 +191,27 @@ public function view($display_options = []) {
/**
* {@inheritdoc}
*/
- public function preSave() {}
+ public function preSave() { }
/**
* {@inheritdoc}
*/
- public function postSave($update) {}
+ public function postSave($update) { }
/**
* {@inheritdoc}
*/
- public function delete() {}
+ public function delete() { }
/**
* {@inheritdoc}
*/
- public static function generateSampleValue(FieldDefinitionInterface $field_definition) {}
+ public static function generateSampleValue(FieldDefinitionInterface $field_definition) { }
/**
* {@inheritdoc}
*/
- public function deleteRevision() {}
+ public function deleteRevision() { }
/**
* {@inheritdoc}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Field/FieldItemList.php
+++ b/core/lib/Drupal/Core/Field/FieldItemList.php
@@ -259,7 +259,7 @@ public function view($display_options = []) {
*/
public function generateSampleItems($count = 1) {
$field_definition = $this->getFieldDefinition();
- $field_type_class = $field_definition->getItemDefinition()->getClass();
+ $field_type_class = \Drupal::service('plugin.manager.field.field_type')->getPluginClass($field_definition->getType());
for ($delta = 0; $delta < $count; $delta++) {
$values[$delta] = $field_type_class::generateSampleValue($field_definition);
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Field/FormatterBase.php
+++ b/core/lib/Drupal/Core/Field/FormatterBase.php
@@ -125,7 +125,7 @@ public function settingsSummary() {
/**
* {@inheritdoc}
*/
- public function prepareView(array $entities_items) {}
+ public function prepareView(array $entities_items) { }
/**
* Returns the array of field settings.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php
@@ -193,6 +193,6 @@ protected function sanitizeLabel(&$label) {
* @return string|null
* Either a label of the empty option, or NULL.
*/
- protected function getEmptyLabel() {}
+ protected function getEmptyLabel() { }
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Flood/MemoryBackend.php
+++ b/core/lib/Drupal/Core/Flood/MemoryBackend.php
@@ -61,9 +61,6 @@ public function isAllowed($name, $threshold, $window = 3600, $identifier = NULL)
if (!isset($identifier)) {
$identifier = $this->requestStack->getCurrentRequest()->getClientIp();
}
- if (!isset($this->events[$name][$identifier])) {
- return $threshold > 0;
- }
$limit = microtime(TRUE) - $window;
$number = count(array_filter($this->events[$name][$identifier], function ($timestamp) use ($limit) {
return $timestamp > $limit;
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Form/FormState.php
+++ b/core/lib/Drupal/Core/Form/FormState.php
@@ -1186,7 +1186,7 @@ public function setCleanValueKeys(array $cleanValueKeys) {
*/
public function addCleanValueKey($cleanValueKey) {
$keys = $this->getCleanValueKeys();
- $this->setCleanValueKeys(array_merge((array) $keys, [$cleanValueKey]));
+ $this->setCleanValueKeys(array_merge((array)$keys, [$cleanValueKey]));
return $this;
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitBase.php
+++ b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitBase.php
@@ -73,7 +73,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi
/**
* {@inheritdoc}
*/
- public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {}
+ public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { }
/**
* {@inheritdoc}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/KeyValueStore/NullStorageExpirable.php
+++ b/core/lib/Drupal/Core/KeyValueStore/NullStorageExpirable.php
@@ -59,17 +59,17 @@ public function getAll() {
/**
* {@inheritdoc}
*/
- public function set($key, $value) {}
+ public function set($key, $value) { }
/**
* {@inheritdoc}
*/
- public function setIfNotExists($key, $value) {}
+ public function setIfNotExists($key, $value) { }
/**
* {@inheritdoc}
*/
- public function setMultiple(array $data) {}
+ public function setMultiple(array $data) { }
/**
* {@inheritdoc}
@@ -80,17 +80,17 @@ public function rename($key, $new_key) {
/**
* {@inheritdoc}
*/
- public function delete($key) {}
+ public function delete($key) { }
/**
* {@inheritdoc}
*/
- public function deleteMultiple(array $keys) {}
+ public function deleteMultiple(array $keys) { }
/**
* {@inheritdoc}
*/
- public function deleteAll() {}
+ public function deleteAll() { }
/**
* {@inheritdoc}
@@ -102,16 +102,16 @@ public function getCollectionName() {
/**
* {@inheritdoc}
*/
- public function setMultipleWithExpire(array $data, $expire) {}
+ public function setMultipleWithExpire(array $data, $expire) { }
/**
* {@inheritdoc}
*/
- public function setWithExpire($key, $value, $expire) {}
+ public function setWithExpire($key, $value, $expire) { }
/**
* {@inheritdoc}
*/
- public function setWithExpireIfNotExists($key, $value, $expire) {}
+ public function setWithExpireIfNotExists($key, $value, $expire) { }
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Mail/MailFormatHelper.php
+++ b/core/lib/Drupal/Core/Mail/MailFormatHelper.php
@@ -106,8 +106,7 @@ public static function htmlToText($string, $allowed_tags = NULL) {
if (empty(static::$supportedTags)) {
static::$supportedTags = ['a', 'em', 'i', 'strong', 'b', 'br', 'p',
'blockquote', 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'h1', 'h2', 'h3',
- 'h4', 'h5', 'h6', 'hr',
- ];
+ 'h4', 'h5', 'h6', 'hr'];
}
// Make sure only supported tags are kept.
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php
+++ b/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php
@@ -75,7 +75,7 @@ public function mail(array $message) {
$mail_body = preg_replace('@\r?\n@', $line_endings, $message['body']);
// For headers, PHP's API suggests that we use CRLF normally,
// but some MTAs incorrectly replace LF with CRLF. See #234403.
- $mail_headers = implode("\n", $mimeheaders);
+ $mail_headers = join("\n", $mimeheaders);
$request = \Drupal::request();
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php
+++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php
@@ -234,7 +234,7 @@ public function getLocalTasksForRoute($route_name) {
if ($base_routes) {
// Find all the plugins with the same root and that are at the top
// level or that have a visible parent.
- foreach ($definitions as $plugin_id => $task_info) {
+ foreach ($definitions as $plugin_id => $task_info) {
if (!empty($base_routes[$task_info['base_route']]) && (empty($task_info['parent_id']) || !empty($parents[$task_info['parent_id']]))) {
// Concat '> ' with root ID for the parent of top-level tabs.
$parent = empty($task_info['parent_id']) ? '> ' . $task_info['base_route'] : $task_info['parent_id'];
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Render/HtmlResponse.php
+++ b/core/lib/Drupal/Core/Render/HtmlResponse.php
@@ -31,11 +31,9 @@ public function setContent($content) {
// A render array can automatically be converted to a string and set the
// necessary metadata.
if (is_array($content) && (isset($content['#markup']))) {
- $content += [
- '#attached' => [
- 'html_response_attachment_placeholders' => [],
- 'placeholders' => [],
- ],
+ $content += ['#attached' => [
+ 'html_response_attachment_placeholders' => [],
+ 'placeholders' => []],
];
$this->addCacheableDependency(CacheableMetadata::createFromRenderArray($content));
$this->setAttachments($content['#attached']);
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -309,9 +309,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) {
if (count($elements['#lazy_builder']) !== 2) {
throw new \DomainException('The #lazy_builder property must have an array as a value, containing two values: the callback, and the arguments for the callback.');
}
- if (count($elements['#lazy_builder'][1]) !== count(array_filter($elements['#lazy_builder'][1], function($v) {
- return is_null($v) || is_scalar($v);
- }))) {
+ if (count($elements['#lazy_builder'][1]) !== count(array_filter($elements['#lazy_builder'][1], function($v) { return is_null($v) || is_scalar($v); }))) {
throw new \DomainException("A #lazy_builder callback's context may only contain scalar values or NULL.");
}
$children = Element::children($elements);
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Routing/GeneratorNotInitializedException.php
+++ b/core/lib/Drupal/Core/Routing/GeneratorNotInitializedException.php
@@ -5,4 +5,4 @@
/**
* Class for exceptions thrown when the generator has not been initialized.
*/
-class GeneratorNotInitializedException extends \Exception {}
+class GeneratorNotInitializedException extends \Exception { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Routing/RouteProvider.php
+++ b/core/lib/Drupal/Core/Routing/RouteProvider.php
@@ -347,8 +347,7 @@ protected function getRoutesByPath($path) {
// dump the route pattern without those optional parts.
try {
$routes = $this->connection->query("SELECT name, route, fit FROM {" . $this->connection->escapeTable($this->tableName) . "} WHERE pattern_outline IN ( :patterns[] ) AND number_parts >= :count_parts", [
- ':patterns[]' => $ancestors,
- ':count_parts' => count($parts),
+ ':patterns[]' => $ancestors, ':count_parts' => count($parts),
])
->fetchAll(\PDO::FETCH_ASSOC);
}
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Utility/UpdateException.php
+++ b/core/lib/Drupal/Core/Utility/UpdateException.php
@@ -5,4 +5,4 @@
/**
* Exception class used to throw error if a module update fails.
*/
-class UpdateException extends \Exception {}
+class UpdateException extends \Exception { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/IsNullConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/IsNullConstraint.php
@@ -15,4 +15,4 @@
* type = false
* )
*/
-class IsNullConstraint extends IsNull {}
+class IsNullConstraint extends IsNull { }
only in patch2:
unchanged:
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/NotNullConstraint.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/NotNullConstraint.php
@@ -15,4 +15,4 @@
* type = false
* )
*/
-class NotNullConstraint extends NotNull {}
+class NotNullConstraint extends NotNull { }
only in patch2:
unchanged:
--- a/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php
+++ b/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php
@@ -84,13 +84,11 @@ public function fetch(FeedInterface $feed) {
/** @var \Psr\Http\Message\UriInterface $actual_uri */
$actual_uri = NULL;
- $response = $this->httpClientFactory->fromOptions([
- 'allow_redirects' => [
- 'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) {
- $actual_uri = (string) $uri;
- }
- ],
- ])->send($request);
+ $response = $this->httpClientFactory->fromOptions(['allow_redirects' => [
+ 'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) {
+ $actual_uri = (string) $uri;
+ }
+ ]])->send($request);
// In case of a 304 Not Modified, there is no new content, so return
// FALSE.
only in patch2:
unchanged:
--- a/core/modules/big_pipe/tests/modules/big_pipe_test/src/Form/BigPipeTestForm.php
+++ b/core/modules/big_pipe/tests/modules/big_pipe_test/src/Form/BigPipeTestForm.php
@@ -35,6 +35,6 @@ public function buildForm(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
- public function submitForm(array &$form, FormStateInterface $form_state) {}
+ public function submitForm(array &$form, FormStateInterface $form_state) { }
}
only in patch2:
unchanged:
--- a/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
+++ b/core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
@@ -374,9 +374,7 @@ protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholde
}
ksort($placeholder_positions, SORT_NUMERIC);
$this->assertEqual(array_keys($expected_big_pipe_placeholders), array_values($placeholder_positions));
- $placeholders = array_map(function(NodeElement $element) {
- return $element->getAttribute('data-big-pipe-placeholder-id');
- }, $this->cssSelect('[data-big-pipe-placeholder-id]'));
+ $placeholders = array_map(function(NodeElement $element) { return $element->getAttribute('data-big-pipe-placeholder-id'); }, $this->cssSelect('[data-big-pipe-placeholder-id]'));
$this->assertEqual(count($expected_big_pipe_placeholders), count(array_unique($placeholders)));
$expected_big_pipe_placeholders_with_replacements = [];
foreach ($expected_big_pipe_placeholder_stream_order as $big_pipe_placeholder_id) {
only in patch2:
unchanged:
--- a/core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php
+++ b/core/modules/big_pipe/tests/src/Unit/Render/Placeholder/BigPipeStrategyTest.php
@@ -83,29 +83,25 @@ public function placeholdersProvider() {
'_no_big_pipe present, no session, no-JS cookie present' => [$placeholders, 'GET', TRUE, FALSE, TRUE, []],
'_no_big_pipe present, session, no-JS cookie absent' => [$placeholders, 'GET', TRUE, TRUE, FALSE, []],
'_no_big_pipe present, session, no-JS cookie present' => [$placeholders, 'GET', TRUE, TRUE, TRUE, []],
- '_no_big_pipe absent, session, no-JS cookie absent: (JS-powered) BigPipe placeholder used for HTML placeholders' => [
- $placeholders, 'GET', FALSE, TRUE, FALSE, [
- $cases['html']->placeholder => $cases['html']->bigPipePlaceholderRenderArray,
- $cases['html_attribute_value']->placeholder => $cases['html_attribute_value']->bigPipeNoJsPlaceholderRenderArray,
- $cases['html_attribute_value_subset']->placeholder => $cases['html_attribute_value_subset']->bigPipeNoJsPlaceholderRenderArray,
- $cases['edge_case__invalid_html']->placeholder => $cases['edge_case__invalid_html']->bigPipeNoJsPlaceholderRenderArray,
- $cases['edge_case__html_non_lazy_builder']->placeholder => $cases['edge_case__html_non_lazy_builder']->bigPipePlaceholderRenderArray,
- $cases['exception__lazy_builder']->placeholder => $cases['exception__lazy_builder']->bigPipePlaceholderRenderArray,
- $cases['exception__embedded_response']->placeholder => $cases['exception__embedded_response']->bigPipePlaceholderRenderArray,
- ],
- ],
+ '_no_big_pipe absent, session, no-JS cookie absent: (JS-powered) BigPipe placeholder used for HTML placeholders' => [$placeholders, 'GET', FALSE, TRUE, FALSE, [
+ $cases['html']->placeholder => $cases['html']->bigPipePlaceholderRenderArray,
+ $cases['html_attribute_value']->placeholder => $cases['html_attribute_value']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['html_attribute_value_subset']->placeholder => $cases['html_attribute_value_subset']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['edge_case__invalid_html']->placeholder => $cases['edge_case__invalid_html']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['edge_case__html_non_lazy_builder']->placeholder => $cases['edge_case__html_non_lazy_builder']->bigPipePlaceholderRenderArray,
+ $cases['exception__lazy_builder']->placeholder => $cases['exception__lazy_builder']->bigPipePlaceholderRenderArray,
+ $cases['exception__embedded_response']->placeholder => $cases['exception__embedded_response']->bigPipePlaceholderRenderArray,
+ ]],
'_no_big_pipe absent, session, no-JS cookie absent: (JS-powered) BigPipe placeholder used for HTML placeholders — but unsafe method' => [$placeholders, 'POST', FALSE, TRUE, FALSE, []],
- '_no_big_pipe absent, session, no-JS cookie present: no-JS BigPipe placeholder used for HTML placeholders' => [
- $placeholders, 'GET', FALSE, TRUE, TRUE, [
- $cases['html']->placeholder => $cases['html']->bigPipeNoJsPlaceholderRenderArray,
- $cases['html_attribute_value']->placeholder => $cases['html_attribute_value']->bigPipeNoJsPlaceholderRenderArray,
- $cases['html_attribute_value_subset']->placeholder => $cases['html_attribute_value_subset']->bigPipeNoJsPlaceholderRenderArray,
- $cases['edge_case__invalid_html']->placeholder => $cases['edge_case__invalid_html']->bigPipeNoJsPlaceholderRenderArray,
- $cases['edge_case__html_non_lazy_builder']->placeholder => $cases['edge_case__html_non_lazy_builder']->bigPipeNoJsPlaceholderRenderArray,
- $cases['exception__lazy_builder']->placeholder => $cases['exception__lazy_builder']->bigPipeNoJsPlaceholderRenderArray,
- $cases['exception__embedded_response']->placeholder => $cases['exception__embedded_response']->bigPipeNoJsPlaceholderRenderArray,
- ],
- ],
+ '_no_big_pipe absent, session, no-JS cookie present: no-JS BigPipe placeholder used for HTML placeholders' => [$placeholders, 'GET', FALSE, TRUE, TRUE, [
+ $cases['html']->placeholder => $cases['html']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['html_attribute_value']->placeholder => $cases['html_attribute_value']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['html_attribute_value_subset']->placeholder => $cases['html_attribute_value_subset']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['edge_case__invalid_html']->placeholder => $cases['edge_case__invalid_html']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['edge_case__html_non_lazy_builder']->placeholder => $cases['edge_case__html_non_lazy_builder']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['exception__lazy_builder']->placeholder => $cases['exception__lazy_builder']->bigPipeNoJsPlaceholderRenderArray,
+ $cases['exception__embedded_response']->placeholder => $cases['exception__embedded_response']->bigPipeNoJsPlaceholderRenderArray,
+ ]],
'_no_big_pipe absent, session, no-JS cookie present: no-JS BigPipe placeholder used for HTML placeholders — but unsafe method' => [$placeholders, 'POST', FALSE, TRUE, TRUE, []],
];
}
only in patch2:
unchanged:
--- a/core/modules/block/src/Plugin/migrate/source/Block.php
+++ b/core/modules/block/src/Plugin/migrate/source/Block.php
@@ -84,7 +84,7 @@ public function fields() {
return [
'bid' => $this->t('The block numeric identifier.'),
'module' => $this->t('The module providing the block.'),
- 'delta' => $this->t("The block's delta."),
+ 'delta' => $this->t('The block\'s delta.'),
'theme' => $this->t('Which theme the block is placed in.'),
'status' => $this->t('Whether or not the block is enabled.'),
'weight' => $this->t('Weight of the block for ordering within regions.'),
only in patch2:
unchanged:
--- a/core/modules/block/tests/src/Functional/BlockTest.php
+++ b/core/modules/block/tests/src/Functional/BlockTest.php
@@ -336,7 +336,7 @@ public function moveBlockToRegion(array $block, $region) {
$this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region.
- $this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', ['%region_name' => $region]));
+ $this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', [ '%region_name' => $region]));
// Confirm that the block is being displayed.
$this->drupalGet('');
only in patch2:
unchanged:
--- a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
+++ b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
@@ -267,7 +267,7 @@ public function testBlockRendering() {
$result = $this->xpath('//div[contains(@class, "region-sidebar-first")]/div[contains(@class, "block-views")]/h2');
$this->assertTrue(empty($result), 'The title is not visible.');
- $this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:system.site', 'config:views.view.test_view_block', 'http_response', 'rendered']));
+ $this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:system.site', 'config:views.view.test_view_block' , 'http_response', 'rendered']));
}
/**
@@ -293,7 +293,7 @@ public function testBlockEmptyRendering() {
$this->assertEqual(0, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
// Ensure that the view cacheability metadata is propagated even, for an
// empty block.
- $this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block', 'http_response', 'rendered']));
+ $this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'http_response', 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Add a header displayed on empty result.
@@ -311,7 +311,7 @@ public function testBlockEmptyRendering() {
$this->drupalGet($url);
$this->assertEqual(1, count($this->xpath('//div[contains(@class, "block-views-blocktest-view-block-block-1")]')));
- $this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block', 'http_response', 'rendered']));
+ $this->assertCacheTags(array_merge($block->getCacheTags(), ['block_view', 'config:block_list', 'config:views.view.test_view_block' , 'http_response', 'rendered']));
$this->assertCacheContexts(['url.query_args:_wrapper_format']);
// Hide the header on empty results.
only in patch2:
unchanged:
--- a/core/modules/block/tests/src/Unit/BlockFormTest.php
+++ b/core/modules/block/tests/src/Unit/BlockFormTest.php
@@ -3,8 +3,6 @@
namespace Drupal\Tests\block\Unit;
use Drupal\block\BlockForm;
-use Drupal\block\Entity\Block;
-use Drupal\Core\Block\BlockBase;
use Drupal\Core\Plugin\PluginFormFactoryInterface;
use Drupal\Tests\UnitTestCase;
@@ -85,32 +83,6 @@ protected function setUp() {
}
/**
- * Mocks a block with a block plugin.
- *
- * @param string $machine_name
- * The machine name of the block plugin.
- *
- * @return \Drupal\block\BlockInterface|\PHPUnit_Framework_MockObject_MockObject
- * The mocked block.
- */
- protected function getBlockMockWithMachineName($machine_name) {
- $plugin = $this->getMockBuilder(BlockBase::class)
- ->disableOriginalConstructor()
- ->getMock();
- $plugin->expects($this->any())
- ->method('getMachineNameSuggestion')
- ->will($this->returnValue($machine_name));
-
- $block = $this->getMockBuilder(Block::class)
- ->disableOriginalConstructor()
- ->getMock();
- $block->expects($this->any())
- ->method('getPlugin')
- ->will($this->returnValue($plugin));
- return $block;
- }
-
- /**
* Tests the unique machine name generator.
*
* @see \Drupal\block\BlockForm::getUniqueMachineName()
only in patch2:
unchanged:
--- a/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php
+++ b/core/modules/block/tests/src/Unit/Menu/BlockLocalTasksTest.php
@@ -16,9 +16,9 @@ protected function setUp() {
$this->directoryList = ['block' => 'core/modules/block'];
parent::setUp();
- $config_factory = $this->getConfigFactoryStub([
- 'system.theme' => ['default' => 'test_c'],
- ]);
+ $config_factory = $this->getConfigFactoryStub(['system.theme' => [
+ 'default' => 'test_c',
+ ]]);
$themes = [];
$themes['test_a'] = (object) [
only in patch2:
unchanged:
--- a/core/modules/block_content/block_content.install
+++ b/core/modules/block_content/block_content.install
@@ -6,23 +6,6 @@
*/
use Drupal\Core\Field\BaseFieldDefinition;
-use Drupal\Core\StringTranslation\TranslatableMarkup;
-
-/**
- * Implements hook_update_dependencies().
- */
-function block_content_update_dependencies() {
- // The update function that adds the status field must run after
- // content_translation_update_8400() which fixes NULL values for the
- // 'content_translation_status' field.
- if (\Drupal::moduleHandler()->moduleExists('content_translation')) {
- $dependencies['block_content'][8400] = [
- 'content_translation' => 8400,
- ];
-
- return $dependencies;
- }
-}
/**
* Add 'revision_translation_affected' field to 'block_content' entities.
@@ -87,54 +70,5 @@ function block_content_update_8300() {
$entity_type = $definition_update_manager->getEntityType('block_content');
$entity_type->set('revision_data_table', 'block_content_field_revision');
$definition_update_manager->updateEntityType($entity_type);
-}
-
-/**
- * Add a publishing status field for block_content entities.
- */
-function block_content_update_8400() {
- $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
-
- // Add the published entity key to the block_content entity type.
- $entity_type = $definition_update_manager->getEntityType('block_content');
- $entity_keys = $entity_type->getKeys();
- $entity_keys['published'] = 'status';
- $entity_type->set('entity_keys', $entity_keys);
- $definition_update_manager->updateEntityType($entity_type);
-
- // Add the publishing status field to the block_content entity type.
- $status = BaseFieldDefinition::create('boolean')
- ->setLabel(new TranslatableMarkup('Publishing status'))
- ->setDescription(new TranslatableMarkup('A boolean indicating the published state.'))
- ->setRevisionable(TRUE)
- ->setTranslatable(TRUE)
- ->setDefaultValue(TRUE);
-
- $has_content_translation_status_field = \Drupal::moduleHandler()->moduleExists('content_translation') && $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'block_content');
- if ($has_content_translation_status_field) {
- $status->setInitialValueFromField('content_translation_status');
- }
- else {
- $status->setInitialValue(TRUE);
- }
- $definition_update_manager->installFieldStorageDefinition('status', 'block_content', 'block_content', $status);
-
- // Uninstall the 'content_translation_status' field if needed.
- $database = \Drupal::database();
- if ($has_content_translation_status_field) {
- // First we have to remove the field data.
- $database->update($entity_type->getDataTable())
- ->fields(['content_translation_status' => NULL])
- ->execute();
-
- // A site may have disabled revisionability for this entity type.
- if ($entity_type->isRevisionable()) {
- $database->update($entity_type->getRevisionDataTable())
- ->fields(['content_translation_status' => NULL])
- ->execute();
- }
- $content_translation_status = $definition_update_manager->getFieldStorageDefinition('content_translation_status', 'block_content');
- $definition_update_manager->uninstallFieldStorageDefinition($content_translation_status);
- }
}
only in patch2:
unchanged:
--- a/core/modules/block_content/src/BlockContentAccessControlHandler.php
+++ b/core/modules/block_content/src/BlockContentAccessControlHandler.php
@@ -19,8 +19,7 @@ class BlockContentAccessControlHandler extends EntityAccessControlHandler {
*/
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
if ($operation === 'view') {
- return AccessResult::allowedIf($entity->isPublished())->addCacheableDependency($entity)
- ->orIf(AccessResult::allowedIfHasPermission($account, 'administer blocks'));
+ return AccessResult::allowed();
}
return parent::checkAccess($entity, $operation, $account);
}
only in patch2:
unchanged:
--- a/core/modules/block_content/src/BlockContentInterface.php
+++ b/core/modules/block_content/src/BlockContentInterface.php
@@ -4,13 +4,12 @@
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityChangedInterface;
-use Drupal\Core\Entity\EntityPublishedInterface;
use Drupal\Core\Entity\RevisionLogInterface;
/**
* Provides an interface defining a custom block entity.
*/
-interface BlockContentInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface, EntityPublishedInterface {
+interface BlockContentInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface {
/**
* Returns the block revision log message.
only in patch2:
unchanged:
--- a/core/modules/block_content/src/Entity/BlockContent.php
+++ b/core/modules/block_content/src/Entity/BlockContent.php
@@ -2,7 +2,8 @@
namespace Drupal\block_content\Entity;
-use Drupal\Core\Entity\EditorialContentEntityBase;
+use Drupal\Core\Entity\ContentEntityBase;
+use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
@@ -50,8 +51,7 @@
* "bundle" = "type",
* "label" = "info",
* "langcode" = "langcode",
- * "uuid" = "uuid",
- * "published" = "status",
+ * "uuid" = "uuid"
* },
* revision_metadata_keys = {
* "revision_user" = "revision_user",
@@ -68,7 +68,9 @@
* caching.
* See https://www.drupal.org/node/2284917#comment-9132521 for more information.
*/
-class BlockContent extends EditorialContentEntityBase implements BlockContentInterface {
+class BlockContent extends ContentEntityBase implements BlockContentInterface {
+
+ use EntityChangedTrait;
/**
* The theme the block is being created in.
@@ -172,8 +174,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields['type']->setLabel(t('Block type'))
->setDescription(t('The block type.'));
- $fields['revision_log']->setDescription(t('The log entry explaining the changes in this revision.'));
-
$fields['info'] = BaseFieldDefinition::create('string')
->setLabel(t('Block description'))
->setDescription(t('A brief description of your block.'))
@@ -187,12 +187,35 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
->setDisplayConfigurable('form', TRUE)
->addConstraint('UniqueField', []);
+ $fields['revision_log'] = BaseFieldDefinition::create('string_long')
+ ->setLabel(t('Revision log message'))
+ ->setDescription(t('The log entry explaining the changes in this revision.'))
+ ->setRevisionable(TRUE)
+ ->setDisplayOptions('form', [
+ 'type' => 'string_textarea',
+ 'weight' => 25,
+ 'settings' => [
+ 'rows' => 4,
+ ],
+ ]);
+
$fields['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Changed'))
->setDescription(t('The time that the custom block was last edited.'))
->setTranslatable(TRUE)
->setRevisionable(TRUE);
+ $fields['revision_created'] = BaseFieldDefinition::create('created')
+ ->setLabel(t('Revision create time'))
+ ->setDescription(t('The time that the current revision was created.'))
+ ->setRevisionable(TRUE);
+
+ $fields['revision_user'] = BaseFieldDefinition::create('entity_reference')
+ ->setLabel(t('Revision user'))
+ ->setDescription(t('The user ID of the author of the current revision.'))
+ ->setSetting('target_type', 'user')
+ ->setRevisionable(TRUE);
+
return $fields;
}
only in patch2:
unchanged:
--- a/core/modules/block_content/tests/src/Functional/UnpublishedBlockTest.php
+++ /dev/null
@@ -1,47 +0,0 @@
- 'Test block',
- 'type' => 'basic',
- ]);
- $block_content->save();
-
- $this->placeBlock('block_content:' . $block_content->uuid());
-
- $this->drupalGet('');
- $page = $this->getSession()->getPage();
- $this->assertTrue($page->has('css', '.block-block-content' . $block_content->uuid()));
-
- $block_content->setPublished(FALSE);
- $block_content->save();
-
- $this->drupalGet('');
- $page = $this->getSession()->getPage();
- $this->assertFalse($page->has('css', '.block-block-content' . $block_content->uuid()));
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/block_content/tests/src/Functional/Update/BlockContentUpdateTest.php
+++ b/core/modules/block_content/tests/src/Functional/Update/BlockContentUpdateTest.php
@@ -43,27 +43,4 @@ public function testSimpleUpdates() {
$this->assertEqual('block_content_field_revision', $entity_type->getRevisionDataTable());
}
- /**
- * Tests adding a status field to the block content entity type.
- *
- * @see block_content_update_8400()
- */
- public function testStatusFieldAddition() {
- $schema = \Drupal::database()->schema();
- $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager();
-
- // Run updates.
- $this->runUpdates();
-
- // Check that the field exists and has the correct label.
- $updated_field = $entity_definition_update_manager->getFieldStorageDefinition('status', 'block_content');
- $this->assertEqual('Publishing status', $updated_field->getLabel());
-
- $content_translation_status = $entity_definition_update_manager->getFieldStorageDefinition('content_translation_status', 'block_content');
- $this->assertNull($content_translation_status);
-
- $this->assertFalse($schema->fieldExists('block_content_field_revision', 'content_translation_status'));
- $this->assertFalse($schema->fieldExists('block_content_field_data', 'content_translation_status'));
- }
-
}
only in patch2:
unchanged:
--- a/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php
+++ b/core/modules/block_content/tests/src/Unit/Menu/BlockContentLocalTasksTest.php
@@ -19,9 +19,9 @@ protected function setUp() {
];
parent::setUp();
- $config_factory = $this->getConfigFactoryStub([
- 'system.theme' => ['default' => 'test_c'],
- ]);
+ $config_factory = $this->getConfigFactoryStub(['system.theme' => [
+ 'default' => 'test_c',
+ ]]);
$themes = [];
$themes['test_a'] = (object) [
only in patch2:
unchanged:
--- a/core/modules/ckeditor/ckeditor.module
+++ b/core/modules/ckeditor/ckeditor.module
@@ -17,7 +17,7 @@ function ckeditor_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.ckeditor':
$output = '';
$output .= '
' . t('About') . '
';
- $output .= '
' . t('The CKEditor module provides a highly-accessible, highly-usable visual text editor and adds a toolbar to text fields. Users can use buttons to format content and to create semantically correct and valid HTML. The CKEditor module uses the framework provided by the Text Editor module. It requires JavaScript to be enabled in the browser. For more information, see the online documentation for the CKEditor module and the CKEditor website.', [':doc_url' => 'https://www.drupal.org/documentation/modules/ckeditor', ':cke_url' => 'http://ckeditor.com', ':text_editor' => \Drupal::url('help.page', ['name' => 'editor'])]) . '
';
+ $output .= '
' . t('The CKEditor module provides a highly-accessible, highly-usable visual text editor and adds a toolbar to text fields. Users can use buttons to format content and to create semantically correct and valid HTML. The CKEditor module uses the framework provided by the Text Editor module. It requires JavaScript to be enabled in the browser. For more information, see the online documentation for the CKEditor module and the CKEditor website.', [ ':doc_url' => 'https://www.drupal.org/documentation/modules/ckeditor', ':cke_url' => 'http://ckeditor.com', ':text_editor' => \Drupal::url('help.page', ['name' => 'editor'])]) . '
';
$output .= '
' . t('Uses') . '
';
$output .= '
';
$output .= '
' . t('Enabling CKEditor for individual text formats') . '
' . t('Toggling between formatted text and HTML source') . '
';
$output .= '
' . t('If the Source button is available in the toolbar, users can click this button to disable the visual editor and edit the HTML source directly. After toggling back, the visual editor uses the allowed HTML tags to format the text — independent of whether buttons for these tags are available in the toolbar. If the text format is set to limit the use of HTML tags, then all excluded tags will be stripped out of the HTML source when the user toggles back to the text editor.') . '
';
$output .= '
' . t('Check my spelling as I type') . '
';
- $output .= '
' . t("By default, CKEditor is configured to leverage your browser's spell check capability. Make sure your browser's spell checker is enabled in your browser's settings. To access suggested corrections for misspelled words, it may be necessary to hold the Control or command (Mac) key while right-clicking the misspelling.") . '
';
+ $output .= '
' . t('By default, CKEditor is configured to leverage your browser\'s spell check capability. Make sure your browser\'s spell checker is enabled in your browser\'s settings. To access suggested corrections for misspelled words, it may be necessary to hold the Control or command (Mac) key while right-clicking the misspelling.') . '
';
$output .= '
' . t('Accessibility features') . '
';
$output .= '
' . t('The built in WYSIWYG editor (CKEditor) comes with a number of accessibility features. CKEditor comes with built in keyboard shortcuts, which can be beneficial for both power users and keyboard only users.', [':features' => 'http://docs.ckeditor.com/#!/guide/dev_a11y', ':shortcuts' => 'http://docs.ckeditor.com/#!/guide/dev_shortcuts']) . '
';
$output .= '
' . t('Generating accessible content') . '
';
only in patch2:
unchanged:
--- a/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php
+++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php
@@ -101,9 +101,7 @@ public function validateStylesValue(array $element, FormStateInterface $form_sta
$form_state->setError($element, $this->t('The provided list of styles is syntactically incorrect.'));
}
else {
- $style_names = array_map(function ($style) {
- return $style['name'];
- }, $styles_setting);
+ $style_names = array_map(function ($style) { return $style['name']; }, $styles_setting);
if (count($style_names) !== count(array_unique($style_names))) {
$form_state->setError($element, $this->t('Each style must have a unique label.'));
}
only in patch2:
unchanged:
--- a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php
+++ b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php
@@ -479,7 +479,7 @@ protected function getDefaultToolbarConfig() {
],
[
'name' => 'Tools',
- 'items' => ['Source'],
+ 'items' => ['Source', ],
],
'/',
];
only in patch2:
unchanged:
--- a/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php
+++ b/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php
@@ -101,17 +101,13 @@ public function testLoading() {
list($settings, $editor_settings_present, $editor_js_present, $body, $format_selector) = $this->getThingsToCheck();
$ckeditor_plugin = $this->container->get('plugin.manager.editor')->createInstance('ckeditor');
$editor = Editor::load('filtered_html');
- $expected = [
- 'formats' => [
- 'filtered_html' => [
- 'format' => 'filtered_html',
- 'editor' => 'ckeditor',
- 'editorSettings' => $this->castSafeStrings($ckeditor_plugin->getJSSettings($editor)),
- 'editorSupportsContentFiltering' => TRUE,
- 'isXssSafe' => FALSE,
- ],
- ],
- ];
+ $expected = ['formats' => ['filtered_html' => [
+ 'format' => 'filtered_html',
+ 'editor' => 'ckeditor',
+ 'editorSettings' => $this->castSafeStrings($ckeditor_plugin->getJSSettings($editor)),
+ 'editorSupportsContentFiltering' => TRUE,
+ 'isXssSafe' => FALSE,
+ ]]];
$this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page.");
$this->assertIdentical($expected, $this->castSafeStrings($settings['editor']), "Text Editor module's JavaScript settings on the page are correct.");
$this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.');
@@ -142,9 +138,7 @@ public function testLoading() {
'editorSettings' => $this->castSafeStrings($ckeditor_plugin->getJSSettings($editor)),
'editorSupportsContentFiltering' => TRUE,
'isXssSafe' => FALSE,
- ],
- ],
- ];
+ ]]];
$this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page.");
$this->assertIdentical($expected, $this->castSafeStrings($settings['editor']), "Text Editor module's JavaScript settings on the page are correct.");
$this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.');
only in patch2:
unchanged:
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -28,7 +28,7 @@ function color_help($route_name, RouteMatchInterface $route_match) {
$output .= '
';
$output .= '
' . t('Changing colors') . '
';
$output .= '
' . t('To change the color settings, select the Settings link for your theme on the Appearance page. If the color picker does not appear then the theme is not compatible with the Color module.', [':appearance' => \Drupal::url('system.themes_page')]) . '
';
- $output .= '
' . t("The Color module saves a modified copy of the theme's specified stylesheets in the files directory. If you make any manual changes to your theme's stylesheet, you must save your color settings again, even if you haven't changed the colors. This step is required because the module stylesheets in the files directory need to be recreated to reflect your changes.") . '
';
+ $output .= '
' . t('The Color module saves a modified copy of the theme\'s specified stylesheets in the files directory. If you make any manual changes to your theme\'s stylesheet, you must save your color settings again, even if you haven\'t changed the colors. This step is required because the module stylesheets in the files directory need to be recreated to reflect your changes.') . '
';
$output .= '
';
return $output;
}
@@ -80,7 +80,7 @@ function color_library_info_alter(&$libraries, $extension) {
if (isset($libraries[$name]['css'])) {
// Override stylesheets.
foreach ($libraries[$name]['css'] as $category => $css_assets) {
- foreach ($css_assets as $path => $metadata) {
+ foreach ($css_assets as $path => $metadata) {
// Loop over the path array with recolored CSS files to find matching
// paths which could replace the non-recolored paths.
foreach ($color_paths as $color_path) {
only in patch2:
unchanged:
--- a/core/modules/color/tests/src/Functional/ColorTest.php
+++ b/core/modules/color/tests/src/Functional/ColorTest.php
@@ -117,7 +117,7 @@ public function _testColor($theme, $test_values) {
$stylesheets = $this->config('color.theme.' . $theme)->get('stylesheets');
foreach ($stylesheets as $stylesheet) {
$this->assertPattern('|' . file_url_transform_relative(file_create_url($stylesheet)) . '|', 'Make sure the color stylesheet is included in the content. (' . $theme . ')');
- $stylesheet_content = implode("\n", file($stylesheet));
+ $stylesheet_content = join("\n", file($stylesheet));
$this->assertTrue(strpos($stylesheet_content, 'color: #123456') !== FALSE, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')');
}
@@ -129,7 +129,7 @@ public function _testColor($theme, $test_values) {
$this->drupalGet('');
$stylesheets = $this->config('color.theme.' . $theme)->get('stylesheets');
foreach ($stylesheets as $stylesheet) {
- $stylesheet_content = implode("\n", file($stylesheet));
+ $stylesheet_content = join("\n", file($stylesheet));
$this->assertTrue(strpos($stylesheet_content, 'color: ' . $test_values['scheme_color']) !== FALSE, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')');
}
@@ -141,7 +141,7 @@ public function _testColor($theme, $test_values) {
$stylesheets = \Drupal::state()->get('drupal_css_cache_files') ?: [];
$stylesheet_content = '';
foreach ($stylesheets as $uri) {
- $stylesheet_content .= implode("\n", file(drupal_realpath($uri)));
+ $stylesheet_content .= join("\n", file(drupal_realpath($uri)));
}
$this->assertTrue(strpos($stylesheet_content, 'public://') === FALSE, 'Make sure the color paths have been translated to local paths. (' . $theme . ')');
$config->set('css.preprocess', 0);
only in patch2:
unchanged:
--- a/core/modules/comment/src/CommentViewBuilder.php
+++ b/core/modules/comment/src/CommentViewBuilder.php
@@ -126,15 +126,12 @@ public function buildComponents(array &$build, array $entities, array $displays,
$display = $displays[$entity->bundle()];
if ($display->getComponent('links')) {
$build[$id]['links'] = [
- '#lazy_builder' => [
- 'comment.lazy_builders:renderLinks',
- [
- $entity->id(),
- $view_mode,
- $entity->language()->getId(),
- !empty($entity->in_preview),
- ],
- ],
+ '#lazy_builder' => ['comment.lazy_builders:renderLinks', [
+ $entity->id(),
+ $view_mode,
+ $entity->language()->getId(),
+ !empty($entity->in_preview),
+ ]],
'#create_placeholder' => TRUE,
];
}
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
+++ b/core/modules/comment/src/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
@@ -192,15 +192,12 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
$elements['#cache']['contexts'][] = 'user.roles';
if ($this->currentUser->hasPermission('post comments')) {
$output['comment_form'] = [
- '#lazy_builder' => [
- 'comment.lazy_builders:renderForm',
- [
- $entity->getEntityTypeId(),
- $entity->id(),
- $field_name,
- $this->getFieldSetting('comment_type'),
- ],
- ],
+ '#lazy_builder' => ['comment.lazy_builders:renderForm', [
+ $entity->getEntityTypeId(),
+ $entity->id(),
+ $field_name,
+ $this->getFieldSetting('comment_type'),
+ ]],
'#create_placeholder' => TRUE,
];
}
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/migrate/source/d6/Comment.php
+++ b/core/modules/comment/src/Plugin/migrate/source/d6/Comment.php
@@ -21,9 +21,8 @@ class Comment extends DrupalSqlBase {
public function query() {
$query = $this->select('comments', 'c')
->fields('c', ['cid', 'pid', 'nid', 'uid', 'subject',
- 'comment', 'hostname', 'timestamp', 'status', 'thread', 'name',
- 'mail', 'homepage', 'format',
- ]);
+ 'comment', 'hostname', 'timestamp', 'status', 'thread', 'name',
+ 'mail', 'homepage', 'format']);
$query->innerJoin('node', 'n', 'c.nid = n.nid');
$query->fields('n', ['type']);
$query->orderBy('c.timestamp');
only in patch2:
unchanged:
--- a/core/modules/comment/src/Plugin/views/wizard/Comment.php
+++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php
@@ -28,6 +28,14 @@ class Comment extends WizardPluginBase {
* Set default values for the filters.
*/
protected $filters = [
+ 'status' => [
+ 'value' => TRUE,
+ 'table' => 'comment_field_data',
+ 'field' => 'status',
+ 'plugin_id' => 'boolean',
+ 'entity_type' => 'comment',
+ 'entity_field' => 'status',
+ ],
'status_node' => [
'value' => TRUE,
'table' => 'node_field_data',
only in patch2:
unchanged:
--- a/core/modules/comment/tests/src/Functional/CommentActionsTest.php
+++ b/core/modules/comment/src/Tests/CommentActionsTest.php
@@ -1,6 +1,6 @@
drupalPostForm($this->node->urlInfo(), $edit, t('Preview'));
// Cannot use assertRaw here since both title and body are in the form.
- $preview = (string) $this->cssSelect('.preview')[0]->getHtml();
+ $preview = (string) $this->cssSelect('.preview')[0]->asXML();
$this->assertTrue(strpos($preview, $title) !== FALSE, 'Anonymous user can preview comment title.');
$this->assertTrue(strpos($preview, $body) !== FALSE, 'Anonymous user can preview comment body.');
@@ -56,7 +56,7 @@ public function testAnonymous() {
$edit['comment_body[0][value]'] = $body;
$this->drupalPostForm($this->node->urlInfo(), $edit, t('Preview'));
// Cannot use assertRaw here since both title and body are in the form.
- $preview = (string) $this->cssSelect('.preview')[0]->getHtml();
+ $preview = (string) $this->cssSelect('.preview')[0]->asXML();
$this->assertTrue(strpos($preview, $title) !== FALSE, 'Anonymous user can preview comment title.');
$this->assertTrue(strpos($preview, $body) !== FALSE, 'Anonymous user can preview comment body.');
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['skip comment approval']);
only in patch2:
unchanged:
--- a/core/modules/comment/tests/src/Functional/CommentBlockTest.php
+++ b/core/modules/comment/src/Tests/CommentBlockTest.php
@@ -1,6 +1,6 @@
drupalGet($this->node->urlInfo());
$element = $this->cssSelect('article.js-comment > div');
// Get last child element.
- $element = end($element);
- $this->assertIdentical($element->getTagName(), 'div', 'Last element is comment body.');
+ $element = end($element[0]);
+ $this->assertIdentical($element[0]->getName(), 'div', 'Last element is comment body.');
// Change weight to make links go after comment body.
entity_get_display('comment', 'comment', 'default')
@@ -118,8 +118,8 @@ public function testCommentLinks() {
$this->drupalGet($this->node->urlInfo());
$element = $this->cssSelect('article.js-comment > div');
// Get last child element.
- $element = end($element);
- $this->assertNotEmpty($element->find('css', 'ul.links'), 'Last element is comment links.');
+ $element = end($element[0]);
+ $this->assertIdentical($element[0]->getName(), 'ul', 'Last element is comment links.');
// Make sure we can hide node links.
entity_get_display('node', $this->node->bundle(), 'default')
only in patch2:
unchanged:
--- a/core/modules/comment/src/Tests/CommentNewIndicatorTest.php
+++ b/core/modules/comment/src/Tests/CommentNewIndicatorTest.php
@@ -129,12 +129,10 @@ public function testCommentNewCommentsIndicator() {
$response = $this->renderNewCommentsNodeLinks([$this->node->id()]);
$this->assertResponse(200);
$json = Json::decode($response);
- $expected = [
- $this->node->id() => [
- 'new_comment_count' => 1,
- 'first_new_comment_link' => $this->node->url('canonical', ['fragment' => 'new']),
- ],
- ];
+ $expected = [$this->node->id() => [
+ 'new_comment_count' => 1,
+ 'first_new_comment_link' => $this->node->url('canonical', ['fragment' => 'new']),
+ ]];
$this->assertIdentical($expected, $json);
// Failing to specify node IDs for the endpoint should return a 404.
only in patch2:
unchanged:
--- a/core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php
+++ b/core/modules/comment/src/Tests/CommentNodeAccessTest.php
@@ -1,6 +1,6 @@
getURL(), $match);
// Get comment.
- if ($contact !== TRUE) {// If true then attempting to find error message.
+ if ($contact !== TRUE) { // If true then attempting to find error message.
if ($subject) {
$this->assertText($subject, 'Comment subject posted.');
}
@@ -274,7 +273,7 @@ public function testCommentFunctionality() {
// Test breadcrumb on comment add page.
$this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment');
$xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
- $this->assertEqual(current($this->xpath($xpath))->getText(), $this->entity->label(), 'Last breadcrumb item is equal to node title on comment reply page.');
+ $this->assertEqual(current($this->xpath($xpath)), $this->entity->label(), 'Last breadcrumb item is equal to node title on comment reply page.');
// Post a comment.
/** @var \Drupal\comment\CommentInterface $comment1 */
@@ -284,17 +283,17 @@ public function testCommentFunctionality() {
// Test breadcrumb on comment reply page.
$this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment/' . $comment1->id());
$xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
- $this->assertEqual(current($this->xpath($xpath))->getText(), $comment1->getSubject(), 'Last breadcrumb item is equal to comment title on comment reply page.');
+ $this->assertEqual(current($this->xpath($xpath)), $comment1->getSubject(), 'Last breadcrumb item is equal to comment title on comment reply page.');
// Test breadcrumb on comment edit page.
$this->drupalGet('comment/' . $comment1->id() . '/edit');
$xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
- $this->assertEqual(current($this->xpath($xpath))->getText(), $comment1->getSubject(), 'Last breadcrumb item is equal to comment subject on edit page.');
+ $this->assertEqual(current($this->xpath($xpath)), $comment1->getSubject(), 'Last breadcrumb item is equal to comment subject on edit page.');
// Test breadcrumb on comment delete page.
$this->drupalGet('comment/' . $comment1->id() . '/delete');
$xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
- $this->assertEqual(current($this->xpath($xpath))->getText(), $comment1->getSubject(), 'Last breadcrumb item is equal to comment subject on delete confirm page.');
+ $this->assertEqual(current($this->xpath($xpath)), $comment1->getSubject(), 'Last breadcrumb item is equal to comment subject on delete confirm page.');
// Unpublish the comment.
$this->performCommentOperation($comment1, 'unpublish');
only in patch2:
unchanged:
--- a/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
+++ b/core/modules/comment/src/Tests/CommentPreviewTest.php
@@ -1,12 +1,11 @@
assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.');
// Store the content of this page.
+ $content = $this->getRawContent();
$this->drupalPostForm(NULL, [], 'Save');
$this->assertText('Your comment has been posted.');
$elements = $this->xpath('//section[contains(@class, "comment-wrapper")]/article');
$this->assertEqual(1, count($elements));
- // Go back and re-submit the form.
- $this->getSession()->getDriver()->back();
+ // Reset the content of the page to simulate the browser's back button, and
+ // re-submit the form.
+ $this->setRawContent($content);
+ $this->drupalPostForm(NULL, [], 'Save');
$this->assertText('Your comment has been posted.');
$elements = $this->xpath('//section[contains(@class, "comment-wrapper")]/article');
$this->assertEqual(2, count($elements));
@@ -175,11 +173,11 @@ public function testCommentEditPreviewSave() {
// Submit the form using the displayed values.
$displayed = [];
- $displayed['subject[0][value]'] = current($this->xpath("//input[@id='edit-subject-0-value']"))->getValue();
- $displayed['comment_body[0][value]'] = current($this->xpath("//textarea[@id='edit-comment-body-0-value']"))->getValue();
- $displayed['uid'] = current($this->xpath("//input[@id='edit-uid']"))->getValue();
- $displayed['date[date]'] = current($this->xpath("//input[@id='edit-date-date']"))->getValue();
- $displayed['date[time]'] = current($this->xpath("//input[@id='edit-date-time']"))->getValue();
+ $displayed['subject[0][value]'] = (string) current($this->xpath("//input[@id='edit-subject-0-value']/@value"));
+ $displayed['comment_body[0][value]'] = (string) current($this->xpath("//textarea[@id='edit-comment-body-0-value']"));
+ $displayed['uid'] = (string) current($this->xpath("//input[@id='edit-uid']/@value"));
+ $displayed['date[date]'] = (string) current($this->xpath("//input[@id='edit-date-date']/@value"));
+ $displayed['date[time]'] = (string) current($this->xpath("//input[@id='edit-date-time']/@value"));
$this->drupalPostForm('comment/' . $comment->id() . '/edit', $displayed, t('Save'));
// Check that the saved comment is still correct.
only in patch2:
unchanged:
--- a/core/modules/comment/tests/src/Functional/CommentRssTest.php
+++ b/core/modules/comment/src/Tests/CommentRssTest.php
@@ -1,6 +1,6 @@
getURL(), $match);
// Get comment.
- if ($contact !== TRUE) {// If true then attempting to find error message.
+ if ($contact !== TRUE) { // If true then attempting to find error message.
if ($subject) {
$this->assertText($subject, 'Comment subject posted.');
}
@@ -199,12 +192,12 @@ public function commentExists(CommentInterface $comment = NULL, $reply = FALSE)
}
$comment_title = $comment_element[0]->xpath('div/h3/a');
- if (empty($comment_title) || ((string) $comment_title[0]) !== $comment->getSubject()) {
+ if (empty($comment_title) || ((string)$comment_title[0]) !== $comment->getSubject()) {
return FALSE;
}
$comment_body = $comment_element[0]->xpath('div/div/p');
- if (empty($comment_body) || ((string) $comment_body[0]) !== $comment->comment_body->value) {
+ if (empty($comment_body) || ((string)$comment_body[0]) !== $comment->comment_body->value) {
return FALSE;
}
only in patch2:
unchanged:
--- a/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
+++ b/core/modules/comment/src/Tests/CommentThreadingTest.php
@@ -1,6 +1,6 @@
assertPattern('|
' . t("Users can choose a Site language on their profile page. This language is used for email messages, and can be used by modules to determine a user's language. It can also be used for interface text, if the User method is enabled as a Detection and selection method (see below). Administrative users can choose a separate Administration pages language for the interface text on administration pages. This configuration is only available on the user's profile page if the Account administration pages method is enabled (see below).") . '
';
+ $output .= '
' . t('Users can choose a Site language on their profile page. This language is used for email messages, and can be used by modules to determine a user\'s language. It can also be used for interface text, if the User method is enabled as a Detection and selection method (see below). Administrative users can choose a separate Administration pages language for the interface text on administration pages. This configuration is only available on the user\'s profile page if the Account administration pages method is enabled (see below).') . '
';
$output .= '
' . t('Language detection and selection') . '
';
$output .= '
' . t('The Detection and selection page provides several methods for deciding which language is used for displaying interface text. When a method detects and selects an interface language, then the following methods in the list are not applied. You can order them by importance, with your preferred method at the top of the list, followed by one or several fall-back methods.', [':detection' => \Drupal::url('language.negotiation')]);
$output .= '
' . t('URL sets the interface language based on a path prefix or domain (for example specifying de for German would result in URLs like example.com/de/contact). The default language does not require a path prefix, but can have one assigned as well. If the language detection is done by domain name, a domain needs to be specified for each language.') . '
';
$output .= '
' . t('Session determines the interface language from a request or session parameter (for example example.com?language=de would set the interface language to German based on the use of de as the language parameter).') . '
';
- $output .= '
' . t("User follows the language configuration set on the user's profile page.") . '
';
+ $output .= '
' . t('User follows the language configuration set on the user\'s profile page.') . '
';
$output .= '
' . t('Browser sets the interface language based on the browser\'s language settings. Since browsers use different language codes to refer to the same languages, you can add and edit languages codes to map the browser language codes to the language codes used on your site.', [':language_list' => \Drupal::url('entity.configurable_language.collection')]) . '
';
$output .= '
' . t('Account administration pages follows the configuration set as Administration pages language on the profile page of an administrative user. This method is similar to the User method, but only sets the interface text language on administration pages, independent of the interface text language on other pages.') . '
';
- $output .= '
' . t("Selected language allows you to specify the site's default language or a specific language as the fall-back language. This method should be listed last.") . '
';
+ $output .= '
' . t('Selected language allows you to specify the site\'s default language or a specific language as the fall-back language. This method should be listed last.') . '
';
$output .= '
';
return $output;
only in patch2:
unchanged:
--- a/core/modules/language/tests/src/Kernel/Views/ArgumentLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Views/ArgumentLanguageTest.php
@@ -35,9 +35,9 @@ public function testArgument() {
]);
$this->executeView($view, [$langcode]);
- $expected = [
- ['name' => $name],
- ];
+ $expected = [[
+ 'name' => $name,
+ ]];
$this->assertIdenticalResultset($view, $expected, ['views_test_data_name' => 'name']);
$view->destroy();
}
only in patch2:
unchanged:
--- a/core/modules/language/tests/src/Kernel/Views/FilterLanguageTest.php
+++ b/core/modules/language/tests/src/Kernel/Views/FilterLanguageTest.php
@@ -36,9 +36,9 @@ public function testFilter() {
]);
$this->executeView($view);
- $expected = [
- ['name' => $name],
- ];
+ $expected = [[
+ 'name' => $name,
+ ]];
$this->assertIdenticalResultset($view, $expected, ['views_test_data_name' => 'name']);
$expected = [
only in patch2:
unchanged:
--- a/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
+++ b/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
@@ -135,7 +135,7 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin
$values['title'] = mt_rand(0, 1) ? $random->sentences(4) : '';
break;
}
- $values['uri'] = 'http://www.' . $random->word($domain_length) . '.' . $tlds[mt_rand(0, (count($tlds) - 1))];
+ $values['uri'] = 'http://www.' . $random->word($domain_length) . '.' . $tlds[mt_rand(0, (sizeof($tlds) - 1))];
}
else {
$values['uri'] = 'base:' . $random->name(mt_rand(1, 64));
only in patch2:
unchanged:
--- a/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php
+++ b/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php
@@ -14,4 +14,4 @@
* @deprecated in Drupal 8.3.x, to be removed before Drupal 9.0.x. Use
* \Drupal\link\Plugin\migrate\process\d6\FieldLink instead.
*/
-class CckLink extends FieldLink {}
+class CckLink extends FieldLink { }
only in patch2:
unchanged:
--- a/core/modules/locale/locale.batch.inc
+++ b/core/modules/locale/locale.batch.inc
@@ -238,13 +238,11 @@ function locale_translation_http_check($uri) {
$logger = \Drupal::logger('locale');
try {
$actual_uri = NULL;
- $response = \Drupal::service('http_client_factory')->fromOptions([
- 'allow_redirects' => [
- 'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $request_uri) use (&$actual_uri) {
- $actual_uri = (string) $request_uri;
- }
- ],
- ])->head($uri);
+ $response = \Drupal::service('http_client_factory')->fromOptions(['allow_redirects' => [
+ 'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $request_uri) use (&$actual_uri) {
+ $actual_uri = (string) $request_uri;
+ }
+ ]])->head($uri);
$result = [];
// Return the effective URL if it differs from the requested.
only in patch2:
unchanged:
--- a/core/modules/locale/src/Form/ImportForm.php
+++ b/core/modules/locale/src/Form/ImportForm.php
@@ -166,7 +166,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->moduleHandler->loadInclude('locale', 'translation.inc');
+ \Drupal::moduleHandler()->loadInclude('locale', 'translation.inc');
// Add language, if not yet supported.
$language = $this->languageManager->getLanguage($form_state->getValue('langcode'));
if (empty($language)) {
@@ -185,6 +185,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
batch_set($batch);
// Create or update all configuration translations for this language.
+ \Drupal::moduleHandler()->loadInclude('locale', 'bulk.inc');
if ($batch = locale_config_batch_update_components($options, [$form_state->getValue('langcode')])) {
batch_set($batch);
}
only in patch2:
unchanged:
--- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
@@ -231,7 +231,7 @@ protected function assertNodeConfig($required, $optional) {
}
// Check the optional default configuration in node module.
- $string = $this->storage->findString(['source' => 'No front page content has been created yet. Follow the User Guide to start building your site.', 'context' => '', 'type' => 'configuration']);
+ $string = $this->storage->findString(['source' => 'No front page content has been created yet.', 'context' => '', 'type' => 'configuration']);
if ($optional) {
$this->assertFalse($this->config('views.view.frontpage')->isNew());
$this->assertTrue($string, 'Node view text can be found with node and views modules.');
only in patch2:
unchanged:
--- a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
@@ -341,8 +341,7 @@ public function testConfigtranslationImportingPoFile() {
// Import a .po file to translate.
$this->importPoFile($this->getPoFileWithConfigDe(), [
- 'langcode' => $langcode,
- ]);
+ 'langcode' => $langcode]);
// Check that the 'Anonymous' string is translated.
$config = \Drupal::languageManager()->getLanguageConfigOverride($langcode, 'user.settings');
only in patch2:
unchanged:
--- a/core/modules/media/src/Entity/Media.php
+++ b/core/modules/media/src/Entity/Media.php
@@ -152,7 +152,7 @@ public function getOwnerId() {
* {@inheritdoc}
*/
public function setOwnerId($uid) {
- return $this->set('uid', $uid);
+ $this->set('uid', $uid);
}
/**
only in patch2:
unchanged:
--- a/core/modules/media/src/Plugin/views/wizard/Media.php
+++ b/core/modules/media/src/Plugin/views/wizard/Media.php
@@ -23,6 +23,22 @@ class Media extends WizardPluginBase {
protected $createdColumn = 'media_field_data-created';
/**
+ * Set default values for the filters.
+ *
+ * @var array
+ */
+ protected $filters = [
+ 'status' => [
+ 'value' => '1',
+ 'table' => 'media_field_data',
+ 'field' => 'status',
+ 'plugin_id' => 'boolean',
+ 'entity_type' => 'media',
+ 'entity_field' => 'status',
+ ],
+ ];
+
+ /**
* {@inheritdoc}
*/
public function getAvailableSorts() {
only in patch2:
unchanged:
--- a/core/modules/media/src/Plugin/views/wizard/MediaRevision.php
+++ b/core/modules/media/src/Plugin/views/wizard/MediaRevision.php
@@ -23,6 +23,22 @@ class MediaRevision extends WizardPluginBase {
protected $createdColumn = 'media_field_revision-created';
/**
+ * Set default values for the filters.
+ *
+ * @var array
+ */
+ protected $filters = [
+ 'status' => [
+ 'value' => '1',
+ 'table' => 'media_field_revision',
+ 'field' => 'status',
+ 'plugin_id' => 'boolean',
+ 'entity_type' => 'media',
+ 'entity_field' => 'status',
+ ],
+ ];
+
+ /**
* {@inheritdoc}
*/
protected function defaultDisplayOptions() {
only in patch2:
unchanged:
--- a/core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-container->get('plugin.manager.link_relation_type');
- $media = Media::create(['bundle' => $this->testMediaType->id()]);
- $media->save();
- foreach ($media->uriRelationships() as $relation_name) {
- $this->assertTrue($link_relation_type_manager->hasDefinition($relation_name), "Link relationship '{$relation_name}' for Media entity");
- }
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/media/tests/src/Kernel/MediaTest.php
+++ /dev/null
@@ -1,23 +0,0 @@
- $this->testMediaType->id()]);
-
- $this->assertSame($media, $media->setOwnerId($this->user->id()), 'setOwnerId() method returns its own entity.');
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuCacheTagsTest.php
@@ -82,9 +82,9 @@ public function testMenuBlock() {
'parent' => '',
'title' => 'Alpaca',
'menu_name' => 'llama',
- 'link' => [
- ['uri' => 'internal:/'],
- ],
+ 'link' => [[
+ 'uri' => 'internal:/',
+ ]],
'bundle' => 'menu_name',
]);
$menu_link_2->save();
only in patch2:
unchanged:
--- a/core/modules/migrate/src/MigrateExecutable.php
+++ b/core/modules/migrate/src/MigrateExecutable.php
@@ -96,16 +96,16 @@ class MigrateExecutable implements MigrateExecutableInterface {
* @param \Drupal\migrate\Plugin\MigrationInterface $migration
* The migration to run.
* @param \Drupal\migrate\MigrateMessageInterface $message
- * (optional) The migrate message service.
+ * The migrate message service.
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
- * (optional) The event dispatcher.
+ * The event dispatcher.
*
* @throws \Drupal\migrate\MigrateException
*/
- public function __construct(MigrationInterface $migration, MigrateMessageInterface $message = NULL, EventDispatcherInterface $event_dispatcher = NULL) {
+ public function __construct(MigrationInterface $migration, MigrateMessageInterface $message, EventDispatcherInterface $event_dispatcher = NULL) {
$this->migration = $migration;
- $this->message = $message ?: new MigrateMessage();
- $this->migration->getIdMap()->setMessage($this->message);
+ $this->message = $message;
+ $this->migration->getIdMap()->setMessage($message);
$this->eventDispatcher = $event_dispatcher;
// Record the memory limit in bytes
$limit = trim(ini_get('memory_limit'));
only in patch2:
unchanged:
--- a/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php
+++ b/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php
@@ -22,4 +22,4 @@
*
* @see https://www.drupal.org/node/2873762
*/
-class DedupeEntity extends MakeUniqueEntityField {}
+class DedupeEntity extends MakeUniqueEntityField { }
only in patch2:
unchanged:
--- a/core/modules/migrate/src/Plugin/migrate/process/Migration.php
+++ b/core/modules/migrate/src/Plugin/migrate/process/Migration.php
@@ -17,4 +17,4 @@
* @deprecated in Drupal 8.3.x and will be removed in Drupal 9.0.x.
* Use \Drupal\migrate\Plugin\migrate\process\MigrationLookup instead.
*/
-class Migration extends MigrationLookup {}
+class Migration extends MigrationLookup { }
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php
+++ b/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php
@@ -3,6 +3,7 @@
namespace Drupal\Tests\migrate\Functional\process;
use Drupal\migrate\MigrateExecutable;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Plugin\MigrateIdMapInterface;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\Tests\BrowserTestBase;
@@ -50,7 +51,7 @@ public function testExceptionThrow() {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition);
- $executable = new MigrateExecutable($migration);
+ $executable = new MigrateExecutable($migration, new MigrateMessage());
$result = $executable->import();
// Check that the migration has completed.
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentBaseTest.php
@@ -5,6 +5,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\migrate\MigrateExecutable;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Plugin\migrate\destination\EntityContentBase;
use Drupal\migrate\Plugin\MigrateIdMapInterface;
use Drupal\migrate\Plugin\MigrationInterface;
@@ -189,7 +190,7 @@ public function testEntityWithStringId() {
];
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition);
- $executable = new MigrateExecutable($migration);
+ $executable = new MigrateExecutable($migration, new MigrateMessage());
$result = $executable->import();
$this->assertEquals(MigrationInterface::RESULT_COMPLETED, $result);
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php
@@ -7,6 +7,7 @@
use Drupal\migrate\Event\MigrateMapSaveEvent;
use Drupal\migrate\Event\MigratePostRowSaveEvent;
use Drupal\migrate\Event\MigratePreRowSaveEvent;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Event\MigrateEvents;
use Drupal\migrate\MigrateExecutable;
use Drupal\KernelTests\KernelTestBase;
@@ -75,7 +76,7 @@ public function testMigrateEvents() {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition);
- $executable = new MigrateExecutable($migration);
+ $executable = new MigrateExecutable($migration, new MigrateMessage());
// As the import runs, events will be dispatched, recording the received
// information in state.
$executable->import();
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/MigrateInterruptionTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateInterruptionTest.php
@@ -3,6 +3,7 @@
namespace Drupal\Tests\migrate\Kernel;
use Drupal\migrate\Event\MigratePostRowSaveEvent;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Event\MigrateEvents;
use Drupal\migrate\MigrateExecutable;
@@ -55,7 +56,7 @@ public function testMigrateEvents() {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition);
- $executable = new MigrateExecutable($migration);
+ $executable = new MigrateExecutable($migration, new MigrateMessage());
// When the import runs, the first row imported will trigger an
// interruption.
$result = $executable->import();
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php
@@ -3,6 +3,7 @@
namespace Drupal\Tests\migrate\Kernel;
use Drupal\KernelTests\KernelTestBase;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate\Plugin\MigrateIdMapInterface;
@@ -49,7 +50,7 @@ public function testPrepareRowSkip() {
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition);
- $executable = new MigrateExecutable($migration);
+ $executable = new MigrateExecutable($migration, new MigrateMessage());
$result = $executable->import();
$this->assertEqual($result, MigrationInterface::RESULT_COMPLETED);
@@ -84,7 +85,7 @@ public function testPrepareRowSkip() {
];
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition);
- $executable = new MigrateExecutable($migration);
+ $executable = new MigrateExecutable($migration, new MigrateMessage());
$result = $executable->import();
$this->assertEquals($result, MigrationInterface::RESULT_COMPLETED);
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
@@ -39,9 +39,7 @@ protected function getDatabase(array $source_data) {
->createTable($table, [
// SQLite uses loose affinity typing, so it's OK for every field to
// be a text field.
- 'fields' => array_map(function() {
- return ['type' => 'text'];
- }, $pilot),
+ 'fields' => array_map(function() { return ['type' => 'text']; }, $pilot),
]);
$fields = array_keys($pilot);
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php
@@ -230,9 +230,7 @@ protected function mockFailure($migration, array $row, $status = MigrateIdMapInt
$migration = $this->getMigration($migration);
}
/** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
- $destination = array_map(function() {
- return NULL;
- }, $migration->getDestinationPlugin()->getIds());
+ $destination = array_map(function() { return NULL; }, $migration->getDestinationPlugin()->getIds());
$row = new Row($row, $migration->getSourcePlugin()->getIds());
$migration->getIdMap()->saveIdMapping($row, $destination, $status);
}
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php
@@ -89,9 +89,7 @@ public function testGetDefinitions() {
// Any database-based source plugins should fail a requirements test in the
// absence of a source database connection (e.g., a connection with the
// 'migrate' key).
- $source_plugins = array_map(function ($migration_plugin) {
- return $migration_plugin->getSourcePlugin();
- }, $migration_plugins);
+ $source_plugins = array_map(function ($migration_plugin) { return $migration_plugin->getSourcePlugin(); }, $migration_plugins);
foreach ($source_plugins as $id => $source_plugin) {
if ($source_plugin instanceof RequirementsInterface) {
try {
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/process/ExtractTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/ExtractTest.php
@@ -4,6 +4,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\migrate\MigrateExecutable;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Plugin\MigrationInterface;
/**
@@ -65,7 +66,7 @@ public function testMultipleValueExplode(array $source_data, array $expected_dat
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition);
- $executable = new MigrateExecutable($migration);
+ $executable = new MigrateExecutable($migration, new MigrateMessage());
$result = $executable->import();
// Migration needs to succeed before further assertions are made.
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Kernel/process/HandleMultiplesTest.php
+++ b/core/modules/migrate/tests/src/Kernel/process/HandleMultiplesTest.php
@@ -4,6 +4,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\migrate\MigrateExecutable;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Plugin\MigrationInterface;
/**
@@ -93,7 +94,7 @@ public function testScalarAndMultipleValues(array $source_data, array $expected_
$migration = \Drupal::service('plugin.manager.migration')->createStubMigration($definition);
- $executable = new MigrateExecutable($migration);
+ $executable = new MigrateExecutable($migration, new MigrateMessage());
$result = $executable->import();
// Migration needs to succeed before further assertions are made.
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
@@ -147,9 +147,7 @@ protected function getDatabase(array $database_contents, $connection_options = [
protected function createSchemaFromRow(array $row) {
// SQLite uses loose ("affinity") typing, so it is OK for every column to be
// a text field.
- $fields = array_map(function() {
- return ['type' => 'text'];
- }, $row);
+ $fields = array_map(function() { return ['type' => 'text']; }, $row);
return ['fields' => $fields];
}
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
+++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php
@@ -113,7 +113,7 @@ public function testUntranslatable() {
$this->storage->getEntityType()->willReturn($entity_type->reveal());
$destination = new EntityTestDestination(
- ['translations' => TRUE ],
+ [ 'translations' => TRUE ],
'',
[],
$this->migration->reveal(),
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php
@@ -166,9 +166,7 @@ protected function entityQueryExpects($count) {
->will($this->returnValue($this->entityQuery));
$this->entityQuery->expects($this->exactly($count + 1))
->method('execute')
- ->will($this->returnCallback(function () use (&$count) {
- return $count--;
- }));
+ ->will($this->returnCallback(function () use (&$count) { return $count--;}));
}
/**
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Unit/process/GetTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/GetTest.php
@@ -48,9 +48,7 @@ public function testTransformSourceArray() {
$this->plugin->setSource(['test1', 'test2']);
$this->row->expects($this->exactly(2))
->method('getSourceProperty')
- ->will($this->returnCallback(function ($argument) use ($map) {
- return $map[$argument];
- }));
+ ->will($this->returnCallback(function ($argument) use ($map) { return $map[$argument]; } ));
$value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destinationproperty');
$this->assertSame($value, ['source_value1', 'source_value2']);
}
@@ -81,9 +79,7 @@ public function testTransformSourceArrayAt() {
$this->plugin->setSource(['test1', '@@test2', '@@test3', 'test4']);
$this->row->expects($this->exactly(4))
->method('getSourceProperty')
- ->will($this->returnCallback(function ($argument) use ($map) {
- return $map[$argument];
- }));
+ ->will($this->returnCallback(function ($argument) use ($map) { return $map[$argument]; } ));
$value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destinationproperty');
$this->assertSame($value, ['source_value1', 'source_value2', 'source_value3', 'source_value4']);
}
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/MakeUniqueEntityFieldTest.php
@@ -165,9 +165,7 @@ protected function entityQueryExpects($count) {
->will($this->returnValue($this->entityQuery));
$this->entityQuery->expects($this->exactly($count + 1))
->method('execute')
- ->will($this->returnCallback(function () use (&$count) {
- return $count--;
- }));
+ ->will($this->returnCallback(function () use (&$count) { return $count--;}));
}
/**
only in patch2:
unchanged:
--- a/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
@@ -4,6 +4,7 @@
use Drupal\migrate\Plugin\migrate\process\UrlEncode;
use Drupal\migrate\MigrateExecutable;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Row;
use Drupal\Tests\migrate\Unit\MigrateTestCase;
@@ -55,7 +56,7 @@ public function testUrls($input, $output) {
* Encoded URL.
*/
protected function doTransform($value) {
- $executable = new MigrateExecutable($this->getMigration());
+ $executable = new MigrateExecutable($this->getMigration(), new MigrateMessage());
$row = new Row();
return (new UrlEncode([], 'urlencode', []))
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/migrate_drupal.module
+++ b/core/modules/migrate_drupal/migrate_drupal.module
@@ -9,6 +9,7 @@
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\migrate\Exception\RequirementsException;
use Drupal\migrate\MigrateExecutable;
+use Drupal\migrate\MigrateMessage;
use Drupal\migrate\Plugin\RequirementsInterface;
/**
@@ -48,7 +49,7 @@ function migrate_drupal_migration_plugins_alter(&$definitions) {
if ($source_plugin instanceof RequirementsInterface) {
$source_plugin->checkRequirements();
}
- $executable = new MigrateExecutable($vocabulary_migration);
+ $executable = new MigrateExecutable($vocabulary_migration, new MigrateMessage());
$process = ['vid' => $definitions['d6_taxonomy_vocabulary']['process']['vid']];
foreach ($source_plugin as $row) {
$executable->processRow($row, $process);
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManager.php
+++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManager.php
@@ -14,4 +14,4 @@
*
* @ingroup migration
*/
-class MigrateCckFieldPluginManager extends MigrateFieldPluginManager implements MigrateCckFieldPluginManagerInterface {}
+class MigrateCckFieldPluginManager extends MigrateFieldPluginManager implements MigrateCckFieldPluginManagerInterface { }
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManagerInterface.php
+++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldPluginManagerInterface.php
@@ -12,4 +12,4 @@
*
* @see https://www.drupal.org/node/2751897
*/
-interface MigrateCckFieldPluginManagerInterface extends MigrateFieldPluginManagerInterface {}
+interface MigrateCckFieldPluginManagerInterface extends MigrateFieldPluginManagerInterface { }
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
+++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php
@@ -150,10 +150,10 @@ public function fields() {
'owner' => t("A theme's 'parent'. Can be either a theme or an engine."),
'status' => t('Boolean indicating whether or not this item is enabled.'),
'throttle' => t('Boolean indicating whether this item is disabled when the throttle.module disables throttleable items.'),
- 'bootstrap' => t("Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted)."),
- 'schema_version' => t("The module's database schema version number."),
- 'weight' => t("The order in which this module's hooks should be invoked."),
- 'info' => t("A serialized array containing information from the module's .info file."),
+ 'bootstrap' => t('Boolean indicating whether this module is loaded during Drupal\'s early bootstrapping phase (e.g. even before the page cache is consulted).'),
+ 'schema_version' => t('The module\'s database schema version number.'),
+ 'weight' => t('The order in which this module\'s hooks should be invoked.'),
+ 'info' => t('A serialized array containing information from the module\'s .info file.'),
];
}
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
+++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
@@ -142,26 +142,16 @@ public function buildOverviewForm(array $form, FormStateInterface $form_state) {
}
else {
$form['info_header'] = [
- '#markup' => '
' . $this->t('Upgrade a site by importing its database and files into a clean and empty new install of Drupal 8. See the Drupal site upgrades handbook for more information.', [
+ '#markup' => '
' . $this->t('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the online documentation for Drupal site upgrades for more detailed information.', [
':url' => 'https://www.drupal.org/upgrade/migrate',
]),
];
- $legend[] = $this->t('Old site: the site you want to upgrade.');
- $legend[] = $this->t('New site: this empty Drupal 8 installation you will import the old site to.');
-
- $form['legend'] = [
- '#theme' => 'item_list',
- '#title' => $this->t('Definitions'),
- '#list_type' => 'ul',
- '#items' => $legend,
- ];
-
- $info[] = $this->t('You may need multiple tries for a successful upgrade so backup the database for this new site. The upgrade will change it and you may want to revert to its initial state.');
- $info[] = $this->t('Make sure that access to the database for the old site is available from this new site.');
- $info[] = $this->t('If the old site has private files, a copy of its files directory must also be accessible on the host of this new site.');
- $info[] = $this->t('Enable all modules on this new site that are enabled on the old site. For example, if the old site uses the book module, then enable the book module on this new site so that the existing data can be imported to it.');
- $info[] = $this->t('Do not add any content to the new site before upgrading. Any existing content is likely to be overwritten by the upgrade process. See the upgrade preparation guide.', [
+ $info[] = $this->t('Back up the database for this site. Upgrade will change the database for this site.');
+ $info[] = $this->t('Make sure that the host this site is on has access to the database for your previous site.');
+ $info[] = $this->t('If your previous site has private files to be migrated, a copy of your files directory must be accessible on the host this site is on.');
+ $info[] = $this->t('In general, enable all modules on this site that are enabled on the previous site. For example, if you have used the book module on the previous site then you must enable the book module on this site for that data to be available on this site.');
+ $info[] = $this->t('Do not add any information on this site (including but not limited to user accounts, taxonomy terms, and node content) before upgrading. Any pre-existing information on the site risks being overwritten by the upgrade process. See the upgrade preparation guide for more information.', [
':url' => 'https://www.drupal.org/docs/8/upgrade/preparing-an-upgrade#dont_create_content',
]);
$info[] = $this->t('Put this site into maintenance mode.', [
@@ -170,13 +160,12 @@ public function buildOverviewForm(array $form, FormStateInterface $form_state) {
$form['info'] = [
'#theme' => 'item_list',
- '#title' => $this->t('Steps to prepare for the upgrade'),
'#list_type' => 'ol',
'#items' => $info,
];
$form['info_footer'] = [
- '#markup' => '
' . $this->t('The upgrade can take a long time. It is better to upgrade from a local copy of your site instead of directly from your live site.'),
+ '#markup' => '
' . $this->t('This upgrade can take a long time. It is better to import a local copy of your site instead of directly importing from your live site.'),
];
$validate = [];
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php
+++ b/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php
@@ -119,7 +119,7 @@ protected function tearDown() {
public function testMigrateUpgrade() {
$connection_options = $this->sourceDatabase->getConnectionOptions();
$this->drupalGet('/upgrade');
- $this->assertText('Upgrade a site by importing its database and files into a clean and empty new install of Drupal 8.');
+ $this->assertText('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the online documentation for Drupal site upgrades for more detailed information.');
$this->drupalPostForm(NULL, [], t('Continue'));
$this->assertText('Provide credentials for the database of the Drupal site you want to upgrade.');
@@ -160,7 +160,7 @@ public function testMigrateUpgrade() {
// Restart the upgrade process.
$this->drupalGet('/upgrade');
- $this->assertText('Upgrade a site by importing its database and files into a clean and empty new install of Drupal 8.');
+ $this->assertText('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the online documentation for Drupal site upgrades for more detailed information.');
$this->drupalPostForm(NULL, [], t('Continue'));
$this->assertText('Provide credentials for the database of the Drupal site you want to upgrade.');
only in patch2:
unchanged:
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
@@ -114,7 +114,7 @@ protected function tearDown() {
public function testMigrateUpgrade() {
$connection_options = $this->sourceDatabase->getConnectionOptions();
$this->drupalGet('/upgrade');
- $this->assertSession()->responseContains('Upgrade a site by importing its database and files into a clean and empty new install of Drupal 8.');
+ $this->assertText('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the online documentation for Drupal site upgrades for more detailed information.');
$this->drupalPostForm(NULL, [], t('Continue'));
$this->assertText('Provide credentials for the database of the Drupal site you want to upgrade.');
@@ -158,7 +158,7 @@ public function testMigrateUpgrade() {
// Restart the upgrade process.
$this->drupalGet('/upgrade');
- $this->assertSession()->responseContains('Upgrade a site by importing its database and files into a clean and empty new install of Drupal 8.');
+ $this->assertSession()->pageTextContains('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the online documentation for Drupal site upgrades for more detailed information.');
$this->drupalPostForm(NULL, [], t('Continue'));
$this->assertSession()->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
only in patch2:
unchanged:
--- a/core/modules/node/config/optional/views.view.frontpage.yml
+++ b/core/modules/node/config/optional/views.view.frontpage.yml
@@ -28,7 +28,7 @@ display:
empty:
area_text_custom:
admin_label: ''
- content: 'No front page content has been created yet. Follow the User Guide to start building your site.'
+ content: 'No front page content has been created yet.'
empty: true
field: area_text_custom
group_type: group
only in patch2:
unchanged:
--- a/core/modules/node/src/Entity/NodeRouteProvider.php
+++ b/core/modules/node/src/Entity/NodeRouteProvider.php
@@ -15,7 +15,7 @@ class NodeRouteProvider implements EntityRouteProviderInterface {
/**
* {@inheritdoc}
*/
- public function getRoutes(EntityTypeInterface $entity_type) {
+ public function getRoutes( EntityTypeInterface $entity_type) {
$route_collection = new RouteCollection();
$route = (new Route('/node/{node}'))
->addDefaults([
only in patch2:
unchanged:
--- a/core/modules/node/src/NodeForm.php
+++ b/core/modules/node/src/NodeForm.php
@@ -142,6 +142,13 @@ public function form(array $form, FormStateInterface $form_state) {
'#wrapper_attributes' => ['class' => ['entity-meta__author']],
];
+ $form['footer'] = [
+ '#type' => 'container',
+ '#weight' => 99,
+ '#attributes' => [
+ 'class' => ['node-form-footer']
+ ]
+ ];
$form['status']['#group'] = 'footer';
// Node author information for administrators.
only in patch2:
unchanged:
--- a/core/modules/node/src/NodeViewBuilder.php
+++ b/core/modules/node/src/NodeViewBuilder.php
@@ -29,14 +29,12 @@ public function buildComponents(array &$build, array $entities, array $displays,
if ($display->getComponent('links')) {
$build[$id]['links'] = [
- '#lazy_builder' => [
- get_called_class() . '::renderLinks', [
- $entity->id(),
- $view_mode,
- $entity->language()->getId(),
- !empty($entity->in_preview),
- ],
- ],
+ '#lazy_builder' => [get_called_class() . '::renderLinks', [
+ $entity->id(),
+ $view_mode,
+ $entity->language()->getId(),
+ !empty($entity->in_preview),
+ ]],
];
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/filter/Access.php
+++ b/core/modules/node/src/Plugin/views/filter/Access.php
@@ -15,8 +15,8 @@
*/
class Access extends FilterPluginBase {
- public function adminSummary() {}
- protected function operatorForm(&$form, FormStateInterface $form_state) {}
+ public function adminSummary() { }
+ protected function operatorForm(&$form, FormStateInterface $form_state) { }
public function canExpose() {
return FALSE;
}
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/filter/Status.php
+++ b/core/modules/node/src/Plugin/views/filter/Status.php
@@ -14,13 +14,11 @@
*/
class Status extends FilterPluginBase {
- public function adminSummary() {}
+ public function adminSummary() { }
- protected function operatorForm(&$form, FormStateInterface $form_state) {}
+ protected function operatorForm(&$form, FormStateInterface $form_state) { }
- public function canExpose() {
- return FALSE;
- }
+ public function canExpose() { return FALSE; }
public function query() {
$table = $this->ensureMyTable();
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/wizard/Node.php
+++ b/core/modules/node/src/Plugin/views/wizard/Node.php
@@ -26,6 +26,20 @@ class Node extends WizardPluginBase {
protected $createdColumn = 'node_field_data-created';
/**
+ * Set default values for the filters.
+ */
+ protected $filters = [
+ 'status' => [
+ 'value' => TRUE,
+ 'table' => 'node_field_data',
+ 'field' => 'status',
+ 'plugin_id' => 'boolean',
+ 'entity_type' => 'node',
+ 'entity_field' => 'status',
+ ]
+ ];
+
+ /**
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::getAvailableSorts().
*
* @return array
only in patch2:
unchanged:
--- a/core/modules/node/src/Plugin/views/wizard/NodeRevision.php
+++ b/core/modules/node/src/Plugin/views/wizard/NodeRevision.php
@@ -25,6 +25,20 @@ class NodeRevision extends WizardPluginBase {
protected $createdColumn = 'changed';
/**
+ * Set default values for the filters.
+ */
+ protected $filters = [
+ 'status' => [
+ 'value' => TRUE,
+ 'table' => 'node_field_revision',
+ 'field' => 'status',
+ 'plugin_id' => 'boolean',
+ 'entity_type' => 'node',
+ 'entity_field' => 'status',
+ ]
+ ];
+
+ /**
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::rowStyleOptions().
*
* Node revisions do not support full posts or teasers, so remove them.
only in patch2:
unchanged:
--- a/core/modules/node/src/Tests/NodeRevisionsTest.php
+++ b/core/modules/node/src/Tests/NodeRevisionsTest.php
@@ -168,11 +168,9 @@ public function testRevisions() {
// Confirm that revisions revert properly.
$this->drupalPostForm("node/" . $node->id() . "/revisions/" . $nodes[1]->getRevisionid() . "/revert", [], t('Revert'));
- $this->assertRaw(t('@type %title has been reverted to the revision from %revision-date.', [
- '@type' => 'Basic page',
- '%title' => $nodes[1]->label(),
- '%revision-date' => format_date($nodes[1]->getRevisionCreationTime())
- ]), 'Revision reverted.');
+ $this->assertRaw(t('@type %title has been reverted to the revision from %revision-date.',
+ ['@type' => 'Basic page', '%title' => $nodes[1]->label(),
+ '%revision-date' => format_date($nodes[1]->getRevisionCreationTime())]), 'Revision reverted.');
$node_storage->resetCache([$node->id()]);
$reverted_node = $node_storage->load($node->id());
$this->assertTrue(($nodes[1]->body->value == $reverted_node->body->value), 'Node reverted correctly.');
@@ -193,11 +191,9 @@ public function testRevisions() {
// Confirm revisions delete properly.
$this->drupalPostForm("node/" . $node->id() . "/revisions/" . $nodes[1]->getRevisionId() . "/delete", [], t('Delete'));
- $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.', [
- '%revision-date' => format_date($nodes[1]->getRevisionCreationTime()),
- '@type' => 'Basic page',
- '%title' => $nodes[1]->label(),
- ]), 'Revision deleted.');
+ $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.',
+ ['%revision-date' => format_date($nodes[1]->getRevisionCreationTime()),
+ '@type' => 'Basic page', '%title' => $nodes[1]->label()]), 'Revision deleted.');
$this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', [':nid' => $node->id(), ':vid' => $nodes[1]->getRevisionId()])->fetchField() == 0, 'Revision not found.');
$this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_field_revision} WHERE nid = :nid and vid = :vid', [':nid' => $node->id(), ':vid' => $nodes[1]->getRevisionId()])->fetchField() == 0, 'Field revision not found.');
only in patch2:
unchanged:
--- a/core/modules/node/tests/modules/node_test/node_test.module
+++ b/core/modules/node/tests/modules/node_test/node_test.module
@@ -156,7 +156,7 @@ function node_test_node_update(NodeInterface $node) {
*/
function node_test_entity_view_mode_alter(&$view_mode, EntityInterface $entity, $context) {
// Only alter the view mode if we are on the test callback.
- $change_view_mode = \Drupal::state()->get('node_test_change_view_mode') ?: '';
+ $change_view_mode = \Drupal::state()->get( 'node_test_change_view_mode') ?: '';
if ($change_view_mode) {
$view_mode = $change_view_mode;
}
only in patch2:
unchanged:
--- a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
@@ -114,7 +114,7 @@ public function testNodeAccessBasic() {
$this->drupalPostForm('node/add/article', $edit, t('Save'));
$node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
- $this->assertEqual($is_private, (int) $node->private->value, 'The private status of the node was properly set in the node_access_test table.');
+ $this->assertEqual($is_private, (int)$node->private->value, 'The private status of the node was properly set in the node_access_test table.');
if ($is_private) {
$private_nodes[] = $node->id();
}
only in patch2:
unchanged:
--- a/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
+++ b/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
@@ -67,9 +67,9 @@ public function testNodeEditAccess() {
// Create a private node (author may view, edit and delete, others may not).
$node = $this->drupalCreateNode([
'type' => 'article',
- 'private' => [
- ['value' => TRUE],
- ],
+ 'private' => [[
+ 'value' => TRUE,
+ ]],
'uid' => $author->id(),
]);
// Create an account that may view the private node, but not edit it.
@@ -134,9 +134,9 @@ public function testNodeDeleteAccess() {
// Create a private node (author may view, edit and delete, others may not).
$private_node = $this->drupalCreateNode([
'type' => 'article',
- 'private' => [
- ['value' => TRUE],
- ],
+ 'private' => [[
+ 'value' => TRUE,
+ ]],
'uid' => $author->id(),
]);
// Create an account that may view the private node, but not delete it.
@@ -146,9 +146,9 @@ public function testNodeDeleteAccess() {
// deleted by the author.
$own_node = $this->drupalCreateNode([
'type' => 'article',
- 'private' => [
- ['value' => TRUE],
- ],
+ 'private' => [[
+ 'value' => TRUE,
+ ]],
'uid' => $account->id(),
]);
$this->drupalLogin($account);
only in patch2:
unchanged:
--- a/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
+++ b/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
@@ -54,12 +54,10 @@ protected function setUp($import_test_views = TRUE) {
$this->drupalLogin($web_user);
foreach ([0 => 'Public', 1 => 'Private'] as $is_private => $type) {
$settings = [
- 'body' => [
- [
- 'value' => $type . ' node',
- 'format' => filter_default_format(),
- ],
- ],
+ 'body' => [[
+ 'value' => $type . ' node',
+ 'format' => filter_default_format(),
+ ]],
'title' => t('@private_public Article created by @user', ['@private_public' => $type, '@user' => $web_user->getUsername()]),
'type' => 'article',
'uid' => $web_user->id(),
only in patch2:
unchanged:
--- a/core/modules/node/tests/src/Functional/Views/NodeRevisionWizardTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeRevisionWizardTest.php
@@ -45,19 +45,16 @@ public function testViewAdd() {
$view['show[wizard_key]'] = 'node_revision';
$this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit'));
- $view = Views::getView($view['id']);
- $view->initHandlers();
+ $view_storage_controller = \Drupal::entityManager()->getStorage('view');
+ /** @var \Drupal\views\Entity\View $view */
+ $view = $view_storage_controller->load($view['id']);
- $this->assertEqual($view->getBaseTables(), ['node_field_revision' => TRUE, '#global' => TRUE]);
+ $this->assertEqual($view->get('base_table'), 'node_field_revision');
- // Check for the default filters.
- $this->assertEqual($view->filter['status']->table, 'node_field_revision');
- $this->assertEqual($view->filter['status']->field, 'status');
- $this->assertTrue($view->filter['status']->value);
+ $executable = Views::executableFactory()->get($view);
+ $this->executeView($executable);
- $this->executeView($view);
-
- $this->assertIdenticalResultset($view, [['vid' => 1], ['vid' => 3], ['vid' => 2], ['vid' => 4]],
+ $this->assertIdenticalResultset($executable, [['vid' => 1], ['vid' => 3], ['vid' => 2], ['vid' => 4]],
['vid' => 'vid']);
}
only in patch2:
unchanged:
--- a/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
@@ -2,7 +2,6 @@
namespace Drupal\Tests\node\Kernel\Migrate\d7;
-use Drupal\Tests\file\Kernel\Migrate\d7\FileMigrationSetupTrait;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
@@ -14,8 +13,6 @@
*/
class MigrateNodeTest extends MigrateDrupal7TestBase {
- use FileMigrationSetupTrait;
-
/**
* {@inheritdoc}
*/
@@ -23,7 +20,6 @@ class MigrateNodeTest extends MigrateDrupal7TestBase {
'content_translation',
'comment',
'datetime',
- 'file',
'filter',
'image',
'language',
@@ -41,11 +37,10 @@ class MigrateNodeTest extends MigrateDrupal7TestBase {
protected function setUp() {
parent::setUp();
- $this->fileMigrationSetup();
-
$this->installEntitySchema('node');
$this->installEntitySchema('comment');
$this->installEntitySchema('taxonomy_term');
+ $this->installEntitySchema('file');
$this->installConfig(static::$modules);
$this->installSchema('node', ['node_access']);
$this->installSchema('system', ['sequences']);
only in patch2:
unchanged:
--- a/core/modules/node/tests/src/Traits/NodeCreationTrait.php
+++ b/core/modules/node/tests/src/Traits/NodeCreationTrait.php
@@ -67,12 +67,10 @@ public function getNodeByTitle($title, $reset = FALSE) {
protected function createNode(array $settings = []) {
// Populate defaults array.
$settings += [
- 'body' => [
- [
- 'value' => $this->randomMachineName(32),
- 'format' => filter_default_format(),
- ],
- ],
+ 'body' => [[
+ 'value' => $this->randomMachineName(32),
+ 'format' => filter_default_format(),
+ ]],
'title' => $this->randomMachineName(8),
'type' => 'page',
'uid' => \Drupal::currentUser()->id(),
only in patch2:
unchanged:
--- a/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
+++ b/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
@@ -222,7 +222,7 @@ protected static function extractAllowedValues($string, $has_data) {
* @return string
* The error message if the specified value is invalid, NULL otherwise.
*/
- protected static function validateAllowedValue($option) {}
+ protected static function validateAllowedValue($option) { }
/**
* Generates a string representation of an array of 'allowed values'.
only in patch2:
unchanged:
--- a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
+++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -94,7 +94,7 @@ public function testOptionsAllowedValuesInteger() {
$node = $this->drupalCreateNode($settings);
// Check that a flat list of values is rejected once the field has data.
- $this->assertAllowedValuesInput("Zero\nOne", 'invalid input', 'Unkeyed lists are rejected once the field has data.');
+ $this->assertAllowedValuesInput( "Zero\nOne", 'invalid input', 'Unkeyed lists are rejected once the field has data.');
// Check that values can be added but values in use cannot be removed.
$string = "0|Zero\n1|One\n2|Two";
only in patch2:
unchanged:
--- a/core/modules/page_cache/src/StackMiddleware/PageCache.php
+++ b/core/modules/page_cache/src/StackMiddleware/PageCache.php
@@ -144,7 +144,7 @@ protected function lookup(Request $request, $type = self::MASTER_REQUEST, $catch
if ($if_modified_since && $if_none_match
&& $if_none_match == $response->getEtag() // etag must match
- && $if_modified_since == $last_modified->getTimestamp()) {// if-modified-since must match
+ && $if_modified_since == $last_modified->getTimestamp()) { // if-modified-since must match
$response->setStatusCode(304);
$response->setContent(NULL);
only in patch2:
unchanged:
--- a/core/modules/page_cache/tests/modules/src/Form/TestForm.php
+++ b/core/modules/page_cache/tests/modules/src/Form/TestForm.php
@@ -25,6 +25,6 @@ public function buildForm(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
- public function submitForm(array &$form, FormStateInterface $form_state) {}
+ public function submitForm(array &$form, FormStateInterface $form_state) { }
}
only in patch2:
unchanged:
--- a/core/modules/path/src/Plugin/Field/FieldType/PathItem.php
+++ b/core/modules/path/src/Plugin/Field/FieldType/PathItem.php
@@ -114,14 +114,6 @@ public function set($property_name, $value, $notify = TRUE) {
/**
* {@inheritdoc}
*/
- public function get($property_name) {
- $this->ensureLoaded();
- return parent::get($property_name);
- }
-
- /**
- * {@inheritdoc}
- */
public function postSave($update) {
if (!$update) {
if ($this->alias) {
only in patch2:
unchanged:
--- a/core/modules/path/tests/src/Kernel/PathItemTest.php
+++ b/core/modules/path/tests/src/Kernel/PathItemTest.php
@@ -70,9 +70,6 @@ public function testPathItem() {
$loaded_node = $node_storage->load($node->id());
$this->assertFalse($loaded_node->get('path')->isEmpty());
$this->assertEquals('/foo', $loaded_node->get('path')->alias);
- $node_storage->resetCache();
- $loaded_node = $node_storage->load($node->id());
- $this->assertEquals('/foo', $loaded_node->get('path')[0]->get('alias')->getValue());
$node_storage->resetCache();
$loaded_node = $node_storage->load($node->id());
only in patch2:
unchanged:
--- a/core/modules/responsive_image/responsive_image.module
+++ b/core/modules/responsive_image/responsive_image.module
@@ -40,7 +40,7 @@ function responsive_image_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.responsive_image':
$output = '';
$output .= '
' . t('About') . '
';
- $output .= '
' . t('The Responsive Image module provides an image formatter that allows browsers to select which image file to display based on media queries or which image file types the browser supports, using the HTML 5 picture and source elements and/or the sizes, srcset and type attributes. For more information, see the online documentation for the Responsive Image module.', [':responsive_image' => 'https://www.drupal.org/documentation/modules/responsive_image']) . '
';
+ $output .= '
' . t('The Responsive Image module provides an image formatter that allows browsers to select which image file to display based on media queries or which image file types the browser supports, using the HTML 5 picture and source elements and/or the sizes, srcset and type attributes. For more information, see the online documentation for the Responsive Image module.', [ ':responsive_image' => 'https://www.drupal.org/documentation/modules/responsive_image']) . '
';
$output .= '
' . t('Uses') . '
';
$output .= '
';
$output .= '
' . t('Defining responsive image styles') . '
';
only in patch2:
unchanged:
--- a/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php
+++ b/core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php
@@ -79,7 +79,7 @@ public function onResponse(FilterResponseEvent $event) {
* Determines the format to respond in.
*
* Respects the requested format if one is specified. However, it is common to
- * forget to specify a response format in case of a POST or PATCH. Rather than
+ * forget to specify a request format in case of a POST or PATCH. Rather than
* simply throwing an error, we apply the robustness principle: when POSTing
* or PATCHing using a certain format, you probably expect a response in that
* same format.
@@ -94,35 +94,33 @@ public function onResponse(FilterResponseEvent $event) {
*/
public function getResponseFormat(RouteMatchInterface $route_match, Request $request) {
$route = $route_match->getRouteObject();
- $acceptable_response_formats = $route->hasRequirement('_format') ? explode('|', $route->getRequirement('_format')) : [];
- $acceptable_request_formats = $route->hasRequirement('_content_type_format') ? explode('|', $route->getRequirement('_content_type_format')) : [];
- $acceptable_formats = $request->isMethodCacheable() ? $acceptable_response_formats : $acceptable_request_formats;
+ $acceptable_request_formats = $route->hasRequirement('_format') ? explode('|', $route->getRequirement('_format')) : [];
+ $acceptable_content_type_formats = $route->hasRequirement('_content_type_format') ? explode('|', $route->getRequirement('_content_type_format')) : [];
+ $acceptable_formats = $request->isMethodCacheable() ? $acceptable_request_formats : $acceptable_content_type_formats;
$requested_format = $request->getRequestFormat();
$content_type_format = $request->getContentType();
- // If an acceptable response format is requested, then use that. Otherwise,
- // including and particularly when the client forgot to specify a response
- // format, then use heuristics to select the format that is most likely
- // expected.
- if (in_array($requested_format, $acceptable_response_formats, TRUE)) {
+ // If an acceptable format is requested, then use that. Otherwise, including
+ // and particularly when the client forgot to specify a format, then use
+ // heuristics to select the format that is most likely expected.
+ if (in_array($requested_format, $acceptable_formats)) {
return $requested_format;
}
-
// If a request body is present, then use the format corresponding to the
// request body's Content-Type for the response, if it's an acceptable
// format for the request.
- if (!empty($request->getContent()) && in_array($content_type_format, $acceptable_request_formats, TRUE)) {
+ elseif (!empty($request->getContent()) && in_array($content_type_format, $acceptable_content_type_formats)) {
return $content_type_format;
}
-
// Otherwise, use the first acceptable format.
- if (!empty($acceptable_formats)) {
+ elseif (!empty($acceptable_formats)) {
return $acceptable_formats[0];
}
-
// Sometimes, there are no acceptable formats, e.g. DELETE routes.
- return NULL;
+ else {
+ return NULL;
+ }
}
/**
only in patch2:
unchanged:
--- a/core/modules/rest/src/Tests/RESTTestBase.php
+++ b/core/modules/rest/src/Tests/RESTTestBase.php
@@ -306,12 +306,10 @@ protected function entityValues($entity_type_id) {
return [
'name' => $this->randomMachineName(),
'user_id' => 1,
- 'field_test_text' => [
- 0 => [
- 'value' => $this->randomString(),
- 'format' => 'plain_text',
- ],
- ],
+ 'field_test_text' => [0 => [
+ 'value' => $this->randomString(),
+ 'format' => 'plain_text',
+ ]],
];
case 'config_test':
return [
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php
+++ b/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php
@@ -71,7 +71,7 @@ protected function initAuthentication() {
$this->sessionCookie = explode(';', $response->getHeader('Set-Cookie')[0], 2)[0];
// Parse and store the CSRF token and logout token.
- $data = $this->serializer->decode((string) $response->getBody(), static::$format);
+ $data = $this->serializer->decode((string)$response->getBody(), static::$format);
$this->csrfToken = $data['csrf_token'];
$this->logoutToken = $data['logout_token'];
}
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentJsonAnonTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-grantPermissionsToTestedRole(['administer blocks']);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createEntity() {
- if (!BlockContentType::load('basic')) {
- $block_content_type = BlockContentType::create([
- 'id' => 'basic',
- 'label' => 'basic',
- 'revision' => TRUE,
- ]);
- $block_content_type->save();
- block_content_add_body_field($block_content_type->id());
- }
-
- // Create a "Llama" custom block.
- $block_content = BlockContent::create([
- 'info' => 'Llama',
- 'type' => 'basic',
- 'body' => [
- 'value' => 'The name "llama" was adopted by European settlers from native Peruvians.',
- 'format' => 'plain_text',
- ],
- ])
- ->setPublished(FALSE);
- $block_content->save();
- return $block_content;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getExpectedNormalizedEntity() {
- return [
- 'id' => [
- [
- 'value' => 1,
- ],
- ],
- 'uuid' => [
- [
- 'value' => $this->entity->uuid(),
- ],
- ],
- 'langcode' => [
- [
- 'value' => 'en',
- ],
- ],
- 'type' => [
- [
- 'target_id' => 'basic',
- 'target_type' => 'block_content_type',
- 'target_uuid' => BlockContentType::load('basic')->uuid(),
- ],
- ],
- 'info' => [
- [
- 'value' => 'Llama',
- ],
- ],
- 'revision_log' => [],
- 'changed' => [
- $this->formatExpectedTimestampItemValues($this->entity->getChangedTime()),
- ],
- 'revision_id' => [
- [
- 'value' => 1,
- ],
- ],
- 'revision_created' => [
- $this->formatExpectedTimestampItemValues((int) $this->entity->getRevisionCreationTime()),
- ],
- 'revision_user' => [],
- 'revision_translation_affected' => [
- [
- 'value' => TRUE,
- ],
- ],
- 'default_langcode' => [
- [
- 'value' => TRUE,
- ],
- ],
- 'body' => [
- [
- 'value' => 'The name "llama" was adopted by European settlers from native Peruvians.',
- 'format' => 'plain_text',
- 'summary' => NULL,
- ],
- ],
- 'status' => [
- [
- 'value' => FALSE,
- ],
- ],
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getNormalizedPostEntity() {
- return [
- 'type' => [
- [
- 'target_id' => 'basic',
- ],
- ],
- 'info' => [
- [
- 'value' => 'Dramallama',
- ],
- ],
- ];
- }
-
-
- /**
- * {@inheritdoc}
- */
- protected function getExpectedUnauthorizedAccessMessage($method) {
- if ($this->config('rest.settings')->get('bc_entity_resource_permissions')) {
- return parent::getExpectedUnauthorizedAccessMessage($method);
- }
-
- return parent::getExpectedUnauthorizedAccessMessage($method);
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormJsonAnonTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-grantPermissionsToTestedRole(['access site-wide contact form']);
- default:
- $this->grantPermissionsToTestedRole(['administer contact forms']);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createEntity() {
- $contact_form = ContactForm::create([
- 'id' => 'llama',
- 'label' => 'Llama',
- 'message' => 'Let us know what you think about llamas',
- 'reply' => 'Llamas are indeed awesome!',
- 'recipients' => [
- 'llama@example.com',
- 'contact@example.com',
- ],
- ]);
- $contact_form->save();
-
- return $contact_form;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getExpectedNormalizedEntity() {
- return [
- 'dependencies' => [],
- 'id' => 'llama',
- 'label' => 'Llama',
- 'langcode' => 'en',
- 'message' => 'Let us know what you think about llamas',
- 'recipients' => [
- 'llama@example.com',
- 'contact@example.com',
- ],
- 'redirect' => NULL,
- 'reply' => 'Llamas are indeed awesome!',
- 'status' => TRUE,
- 'uuid' => $this->entity->uuid(),
- 'weight' => 0,
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getNormalizedPostEntity() {
- // @todo Update in https://www.drupal.org/node/2300677.
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getExpectedUnauthorizedAccessMessage($method) {
- if ($this->config('rest.settings')->get('bc_entity_resource_permissions')) {
- return parent::getExpectedUnauthorizedAccessMessage($method);
- }
-
- return "The 'access site-wide contact form' permission is required.";
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php
@@ -1274,10 +1274,7 @@ protected function assertNormalizationEdgeCases($method, Url $url, array $reques
*/
protected function getEntityResourceUrl() {
$has_canonical_url = $this->entity->hasLinkTemplate('canonical');
- // Note that the 'canonical' link relation type must be specified explicitly
- // in the call to ::toUrl(). 'canonical' is the default for
- // \Drupal\Core\Entity\Entity::toUrl(), but ConfigEntityBase overrides this.
- return $has_canonical_url ? $this->entity->toUrl('canonical') : Url::fromUri('base:entity/' . static::$entityTypeId . '/' . $this->entity->id());
+ return $has_canonical_url ? $this->entity->toUrl() : Url::fromUri('base:entity/' . static::$entityTypeId . '/' . $this->entity->id());
}
/**
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/EntityResource/EntityTestBundle/EntityTestBundleJsonAnonTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-grantPermissionsToTestedRole(['administer entity_test_bundle content']);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createEntity() {
- $entity_test_bundle = EntityTestBundle::create([
- 'id' => 'camelids',
- 'label' => 'Camelids',
- 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.',
- ]);
- $entity_test_bundle->save();
-
- return $entity_test_bundle;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getExpectedNormalizedEntity() {
- return [
- 'dependencies' => [],
- 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.',
- 'id' => 'camelids',
- 'label' => 'Camelids',
- 'langcode' => 'en',
- 'status' => TRUE,
- 'uuid' => $this->entity->uuid(),
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getNormalizedPostEntity() {
- // @todo Update in https://www.drupal.org/node/2300677.
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaJsonAnonTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-grantPermissionsToTestedRole(['view media']);
- break;
-
- case 'POST':
- $this->grantPermissionsToTestedRole(['create media']);
- break;
-
- case 'PATCH':
- $this->grantPermissionsToTestedRole(['update any media']);
- break;
-
- case 'DELETE':
- $this->grantPermissionsToTestedRole(['delete any media']);
- break;
- }
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createEntity() {
- if (!MediaType::load('camelids')) {
- // Create a "Camelids" media type.
- $media_type = MediaType::create([
- 'name' => 'Camelids',
- 'id' => 'camelids',
- 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.',
- 'source' => 'file',
- ]);
- $media_type->save();
- // Create the source field.
- $source_field = $media_type->getSource()->createSourceField($media_type);
- $source_field->getFieldStorageDefinition()->save();
- $source_field->save();
- $media_type
- ->set('source_configuration', [
- 'source_field' => $source_field->getName(),
- ])
- ->save();
- }
-
- // Create a file to upload.
- $file = File::create([
- 'uri' => 'public://llama.txt',
- ]);
- $file->setPermanent();
- $file->save();
-
- // Create a "Llama" media item.
- $media = Media::create([
- 'bundle' => 'camelids',
- 'field_media_file_1' => [
- 'target_id' => $file->id(),
- ],
- ]);
- $media
- ->setName('Llama')
- ->setPublished(TRUE)
- ->setCreatedTime(123456789)
- ->setOwnerId(static::$auth ? $this->account->id() : 0)
- ->setRevisionUserId(static::$auth ? $this->account->id() : 0)
- ->save();
-
- return $media;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getExpectedNormalizedEntity() {
- $file = File::load(1);
- $thumbnail = File::load(2);
- $author = User::load($this->entity->getOwnerId());
- return [
- 'mid' => [
- [
- 'value' => 1,
- ],
- ],
- 'uuid' => [
- [
- 'value' => $this->entity->uuid(),
- ],
- ],
- 'vid' => [
- [
- 'value' => 1,
- ],
- ],
- 'langcode' => [
- [
- 'value' => 'en',
- ],
- ],
- 'bundle' => [
- [
- 'target_id' => 'camelids',
- 'target_type' => 'media_type',
- 'target_uuid' => MediaType::load('camelids')->uuid(),
- ],
- ],
- 'name' => [
- [
- 'value' => 'Llama',
- ],
- ],
- 'field_media_file_1' => [
- [
- 'description' => NULL,
- 'display' => NULL,
- 'target_id' => (int) $file->id(),
- 'target_type' => 'file',
- 'target_uuid' => $file->uuid(),
- 'url' => $file->url(),
- ],
- ],
- 'thumbnail' => [
- [
- 'alt' => 'Thumbnail',
- 'width' => 180,
- 'height' => 180,
- 'target_id' => (int) $thumbnail->id(),
- 'target_type' => 'file',
- 'target_uuid' => $thumbnail->uuid(),
- 'title' => 'Llama',
- 'url' => $thumbnail->url(),
- ],
- ],
- 'status' => [
- [
- 'value' => TRUE,
- ],
- ],
- 'created' => [
- $this->formatExpectedTimestampItemValues(123456789),
- ],
- 'changed' => [
- $this->formatExpectedTimestampItemValues($this->entity->getChangedTime()),
- ],
- 'revision_created' => [
- $this->formatExpectedTimestampItemValues((int) $this->entity->getRevisionCreationTime()),
- ],
- 'default_langcode' => [
- [
- 'value' => TRUE,
- ],
- ],
- 'uid' => [
- [
- 'target_id' => (int) $author->id(),
- 'target_type' => 'user',
- 'target_uuid' => $author->uuid(),
- 'url' => base_path() . 'user/' . $author->id(),
- ],
- ],
- 'revision_user' => [
- [
- 'target_id' => (int) $author->id(),
- 'target_type' => 'user',
- 'target_uuid' => $author->uuid(),
- 'url' => base_path() . 'user/' . $author->id(),
- ],
- ],
- 'revision_log_message' => [],
- 'revision_translation_affected' => [
- [
- 'value' => TRUE,
- ],
- ],
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getNormalizedPostEntity() {
- return [
- 'bundle' => [
- [
- 'target_id' => 'camelids',
- ],
- ],
- 'name' => [
- [
- 'value' => 'Dramallama',
- ],
- ],
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getExpectedUnauthorizedAccessMessage($method) {
- if ($this->config('rest.settings')->get('bc_entity_resource_permissions')) {
- return parent::getExpectedUnauthorizedAccessMessage($method);
- }
-
- switch ($method) {
- case 'GET';
- return "The 'view media' permission is required and the media item must be published.";
-
- case 'PATCH':
- return 'You are not authorized to update this media entity of bundle camelids.';
-
- case 'DELETE':
- return 'You are not authorized to delete this media entity of bundle camelids.';
-
- default:
- return parent::getExpectedUnauthorizedAccessMessage($method);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function testPost() {
- $this->markTestSkipped('POSTing File Media items is not supported until https://www.drupal.org/node/1927648 is solved.');
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/EntityResource/MediaType/MediaTypeJsonAnonTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-grantPermissionsToTestedRole(['administer media types']);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function createEntity() {
- // Create a "Camelids" media type.
- $camelids = MediaType::create([
- 'name' => 'Camelids',
- 'id' => 'camelids',
- 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.',
- 'source' => 'file',
- ]);
-
- $camelids->save();
-
- return $camelids;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getExpectedNormalizedEntity() {
- return [
- 'dependencies' => [],
- 'description' => 'Camelids are large, strictly herbivorous animals with slender necks and long legs.',
- 'field_map' => [],
- 'id' => 'camelids',
- 'label' => NULL,
- 'langcode' => 'en',
- 'new_revision' => FALSE,
- 'queue_thumbnail_downloads' => FALSE,
- 'source' => 'file',
- 'source_configuration' => [
- 'source_field' => '',
- ],
- 'status' => TRUE,
- 'uuid' => $this->entity->uuid(),
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getNormalizedPostEntity() {
- // @todo Update in https://www.drupal.org/node/2300677.
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/ResourceTest.php
+++ b/core/modules/rest/tests/src/Functional/ResourceTest.php
@@ -41,12 +41,10 @@ protected function setUp() {
$this->entity = EntityTest::create([
'name' => $this->randomMachineName(),
'user_id' => 1,
- 'field_test_text' => [
- 0 => [
- 'value' => $this->randomString(),
- 'format' => 'plain_text',
- ],
- ],
+ 'field_test_text' => [0 => [
+ 'value' => $this->randomString(),
+ 'format' => 'plain_text',
+ ]],
]);
$this->entity->save();
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
@@ -667,9 +667,7 @@ public function testFieldapiField() {
$result = Json::decode($this->drupalGet('test/serialize/node-field', ['query' => ['_format' => 'json']]));
$this->assertEqual(count($result[2]['body']), $node->body->count(), 'Expected count of values');
- $this->assertEqual($result[2]['body'], array_map(function($item) {
- return $item['value'];
- }, $node->body->getValue()), 'Expected raw body values found.');
+ $this->assertEqual($result[2]['body'], array_map(function($item) { return $item['value']; }, $node->body->getValue()), 'Expected raw body values found.');
}
/**
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php
+++ b/core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php
@@ -30,9 +30,9 @@ public function testCalculateDependencies(array $configuration) {
$rest_config = RestResourceConfig::create($configuration);
$result = $config_dependencies->calculateDependencies($rest_config);
- $this->assertEquals([
- 'module' => ['basic_auth', 'serialization', 'hal'],
- ], $result);
+ $this->assertEquals(['module' => [
+ 'basic_auth', 'serialization', 'hal',
+ ]], $result);
}
/**
only in patch2:
unchanged:
--- a/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php
+++ b/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php
@@ -78,7 +78,7 @@ public function providerTestSerialization() {
*
* @dataProvider providerTestResponseFormat
*/
- public function testResponseFormat($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
+ public function testResponseFormat($methods, array $supported_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
foreach ($request_headers as $key => $value) {
unset($request_headers[$key]);
$key = strtoupper(str_replace('-', '_', $key));
@@ -92,10 +92,8 @@ public function testResponseFormat($methods, array $supported_response_formats,
if ($request_format) {
$request->setRequestFormat($request_format);
}
-
- $route_requirements = $this->generateRouteRequirements($supported_response_formats, $supported_request_formats);
-
- $route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => $this->randomMachineName()], $route_requirements));
+ $route_requirement_key_format = $request->isMethodCacheable() ? '_format' : '_content_type_format';
+ $route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => $this->randomMachineName()], [$route_requirement_key_format => implode('|', $supported_formats)]));
$resource_response_subscriber = new ResourceResponseSubscriber(
$this->prophesize(SerializerInterface::class)->reveal(),
@@ -115,7 +113,9 @@ public function testResponseFormat($methods, array $supported_response_formats,
*
* @dataProvider providerTestResponseFormat
*/
- public function testOnResponseWithCacheableResponse($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
+ public function testOnResponseWithCacheableResponse($methods, array $supported_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
+ $rest_config_name = $this->randomMachineName();
+
foreach ($request_headers as $key => $value) {
unset($request_headers[$key]);
$key = strtoupper(str_replace('-', '_', $key));
@@ -129,10 +129,8 @@ public function testOnResponseWithCacheableResponse($methods, array $supported_r
if ($request_format) {
$request->setRequestFormat($request_format);
}
-
- $route_requirements = $this->generateRouteRequirements($supported_response_formats, $supported_request_formats);
-
- $route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => $this->randomMachineName()], $route_requirements));
+ $route_requirement_key_format = $request->isMethodCacheable() ? '_format' : '_content_type_format';
+ $route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => $rest_config_name], [$route_requirement_key_format => implode('|', $supported_formats)]));
// The RequestHandler must return a ResourceResponseInterface object.
$handler_response = new ResourceResponse($method !== 'DELETE' ? ['REST' => 'Drupal'] : NULL);
@@ -165,7 +163,9 @@ public function testOnResponseWithCacheableResponse($methods, array $supported_r
*
* @dataProvider providerTestResponseFormat
*/
- public function testOnResponseWithUncacheableResponse($methods, array $supported_response_formats, array $supported_request_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
+ public function testOnResponseWithUncacheableResponse($methods, array $supported_formats, $request_format, array $request_headers, $request_body, $expected_response_format, $expected_response_content_type, $expected_response_content) {
+ $rest_config_name = $this->randomMachineName();
+
foreach ($request_headers as $key => $value) {
unset($request_headers[$key]);
$key = strtoupper(str_replace('-', '_', $key));
@@ -179,10 +179,8 @@ public function testOnResponseWithUncacheableResponse($methods, array $supported
if ($request_format) {
$request->setRequestFormat($request_format);
}
-
- $route_requirements = $this->generateRouteRequirements($supported_response_formats, $supported_request_formats);
-
- $route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => $this->randomMachineName()], $route_requirements));
+ $route_requirement_key_format = $request->isMethodCacheable() ? '_format' : '_content_type_format';
+ $route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => $rest_config_name], [$route_requirement_key_format => implode('|', $supported_formats)]));
// The RequestHandler must return a ResourceResponseInterface object.
$handler_response = new ModifiedResourceResponse($method !== 'DELETE' ? ['REST' => 'Drupal'] : NULL);
@@ -227,7 +225,6 @@ public function providerTestResponseFormat() {
// @todo add 'HEAD' in https://www.drupal.org/node/2752325
['GET'],
['xml', 'json'],
- [],
'json',
[],
NULL,
@@ -239,7 +236,6 @@ public function providerTestResponseFormat() {
// @todo add 'HEAD' in https://www.drupal.org/node/2752325
['GET'],
['xml', 'json'],
- [],
'xml',
[],
NULL,
@@ -251,7 +247,6 @@ public function providerTestResponseFormat() {
// @todo add 'HEAD' in https://www.drupal.org/node/2752325
['GET'],
['json', 'xml'],
- [],
FALSE,
[],
NULL,
@@ -263,7 +258,6 @@ public function providerTestResponseFormat() {
// @todo add 'HEAD' in https://www.drupal.org/node/2752325
['GET'],
['xml', 'json'],
- [],
FALSE,
[],
NULL,
@@ -277,7 +271,6 @@ public function providerTestResponseFormat() {
'unsafe methods with response (POST, PATCH): client requested no format, response should use request body format (JSON)' => [
['POST', 'PATCH'],
['xml', 'json'],
- ['xml', 'json'],
FALSE,
['Content-Type' => 'application/json'],
$json_encoded,
@@ -288,7 +281,6 @@ public function providerTestResponseFormat() {
'unsafe methods with response (POST, PATCH): client requested no format, response should use request body format (XML)' => [
['POST', 'PATCH'],
['xml', 'json'],
- ['xml', 'json'],
FALSE,
['Content-Type' => 'text/xml'],
$xml_encoded,
@@ -299,7 +291,6 @@ public function providerTestResponseFormat() {
'unsafe methods with response (POST, PATCH): client requested format other than request body format (JSON): response format should use requested format (XML)' => [
['POST', 'PATCH'],
['xml', 'json'],
- ['xml', 'json'],
'xml',
['Content-Type' => 'application/json'],
$json_encoded,
@@ -310,7 +301,6 @@ public function providerTestResponseFormat() {
'unsafe methods with response (POST, PATCH): client requested format other than request body format (XML), but is allowed for the request body (JSON)' => [
['POST', 'PATCH'],
['xml', 'json'],
- ['xml', 'json'],
'json',
['Content-Type' => 'text/xml'],
$xml_encoded,
@@ -318,35 +308,12 @@ public function providerTestResponseFormat() {
'application/json',
$json_encoded,
],
- 'unsafe methods with response (POST, PATCH): client requested format other than request body format when only XML is allowed as a content type format' => [
- ['POST', 'PATCH'],
- ['xml'],
- ['json'],
- 'json',
- ['Content-Type' => 'text/xml'],
- $xml_encoded,
- 'json',
- 'application/json',
- $json_encoded,
- ],
- 'unsafe methods with response (POST, PATCH): client requested format other than request body format when only JSON is allowed as a content type format' => [
- ['POST', 'PATCH'],
- ['json'],
- ['xml'],
- 'xml',
- ['Content-Type' => 'application/json'],
- $json_encoded,
- 'xml',
- 'text/xml',
- $xml_encoded,
- ],
];
$unsafe_method_bodyless_test_cases = [
- 'unsafe methods without response bodies (DELETE): client requested no format, response should have no format' => [
+ 'unsafe methods with response bodies (DELETE): client requested no format, response should have no format' => [
['DELETE'],
['xml', 'json'],
- ['xml', 'json'],
FALSE,
['Content-Type' => 'application/json'],
NULL,
@@ -354,10 +321,9 @@ public function providerTestResponseFormat() {
NULL,
'',
],
- 'unsafe methods without response bodies (DELETE): client requested format (XML), response should have no format' => [
+ 'unsafe methods with response bodies (DELETE): client requested format (XML), response should have no format' => [
['DELETE'],
['xml', 'json'],
- ['xml', 'json'],
'xml',
['Content-Type' => 'application/json'],
NULL,
@@ -365,10 +331,9 @@ public function providerTestResponseFormat() {
NULL,
'',
],
- 'unsafe methods without response bodies (DELETE): client requested format (JSON), response should have no format' => [
+ 'unsafe methods with response bodies (DELETE): client requested format (JSON), response should have no format' => [
['DELETE'],
['xml', 'json'],
- ['xml', 'json'],
'json',
['Content-Type' => 'application/json'],
NULL,
@@ -403,26 +368,4 @@ protected function getFunctioningResourceResponseSubscriber(RouteMatchInterface
return $resource_response_subscriber;
}
- /**
- * Generates route requirements based on supported formats.
- *
- * @param array $supported_response_formats
- * The supported response formats to add to the route requirements.
- * @param array $supported_request_formats
- * The supported request formats to add to the route requirements.
- *
- * @return array
- * An array of route requirements.
- */
- protected function generateRouteRequirements(array $supported_response_formats, array $supported_request_formats) {
- $route_requirements = [
- '_format' => implode('|', $supported_response_formats),
- ];
- if (!empty($supported_request_formats)) {
- $route_requirements['_content_type_format'] = implode('|', $supported_request_formats);
- }
-
- return $route_requirements;
- }
-
}
only in patch2:
unchanged:
--- a/core/modules/search/src/Plugin/SearchPluginBase.php
+++ b/core/modules/search/src/Plugin/SearchPluginBase.php
@@ -146,18 +146,16 @@ public function buildSearchUrlQuery(FormStateInterface $form_state) {
public function getHelp() {
// This default search help is appropriate for plugins like NodeSearch
// that use the SearchQuery class.
- $help = [
- 'list' => [
- '#theme' => 'item_list',
- '#items' => [
- $this->t('Search looks for exact, case-insensitive keywords; keywords shorter than a minimum length are ignored.'),
- $this->t('Use upper-case OR to get more results. Example: cat OR dog (content contains either "cat" or "dog").'),
- $this->t('You can use upper-case AND to require all words, but this is the same as the default behavior. Example: cat AND dog (same as cat dog, content must contain both "cat" and "dog").'),
- $this->t('Use quotes to search for a phrase. Example: "the cat eats mice".'),
- $this->t('You can precede keywords by - to exclude them; you must still have at least one "positive" keyword. Example: cat -dog (content must contain cat and cannot contain dog).'),
- ],
+ $help = ['list' => [
+ '#theme' => 'item_list',
+ '#items' => [
+ $this->t('Search looks for exact, case-insensitive keywords; keywords shorter than a minimum length are ignored.'),
+ $this->t('Use upper-case OR to get more results. Example: cat OR dog (content contains either "cat" or "dog").'),
+ $this->t('You can use upper-case AND to require all words, but this is the same as the default behavior. Example: cat AND dog (same as cat dog, content must contain both "cat" and "dog").'),
+ $this->t('Use quotes to search for a phrase. Example: "the cat eats mice".'),
+ $this->t('You can precede keywords by - to exclude them; you must still have at least one "positive" keyword. Example: cat -dog (content must contain cat and cannot contain dog).'),
],
- ];
+ ]];
return $help;
}
only in patch2:
unchanged:
--- a/core/modules/search/src/Plugin/views/argument/Search.php
+++ b/core/modules/search/src/Plugin/views/argument/Search.php
@@ -97,7 +97,7 @@ public function query($group_by = FALSE) {
$search_dataset = $this->query->addTable('node_search_dataset');
$conditions = $this->searchQuery->conditions();
$condition_conditions =& $conditions->conditions();
- foreach ($condition_conditions as $key => &$condition) {
+ foreach ($condition_conditions as $key => &$condition) {
// Make sure we just look at real conditions.
if (is_numeric($key)) {
// Replace the conditions with the table alias of views.
only in patch2:
unchanged:
--- a/core/modules/search/src/Plugin/views/filter/Search.php
+++ b/core/modules/search/src/Plugin/views/filter/Search.php
@@ -172,7 +172,7 @@ public function query() {
$search_dataset = $this->query->addTable('node_search_dataset');
$conditions = $this->searchQuery->conditions();
$condition_conditions =& $conditions->conditions();
- foreach ($condition_conditions as $key => &$condition) {
+ foreach ($condition_conditions as $key => &$condition) {
// Make sure we just look at real conditions.
if (is_numeric($key)) {
// Replace the conditions with the table alias of views.
only in patch2:
unchanged:
--- a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php
@@ -177,7 +177,7 @@ public function testSearchModuleDisabling() {
$this->submitGetForm('node', $terms, t('Search'));
$current = $this->getURL();
$expected = \Drupal::url('search.view_' . $entity->id(), [], ['query' => ['keys' => $info['keys']], 'absolute' => TRUE]);
- $this->assertEqual($current, $expected, 'Block redirected to right search page');
+ $this->assertEqual( $current, $expected, 'Block redirected to right search page');
// Try an invalid search path, which should 404.
$this->drupalGet('search/not_a_plugin_path');
only in patch2:
unchanged:
--- a/core/modules/search/src/Tests/SearchNodeUpdateAndDeletionTest.php
+++ b/core/modules/search/src/Tests/SearchNodeUpdateAndDeletionTest.php
@@ -39,8 +39,7 @@ public function testSearchIndexUpdateOnNodeChange() {
$node = $this->drupalCreateNode([
'title' => 'Someone who says Ni!',
'body' => [['value' => "We are the knights who say Ni!"]],
- 'type' => 'page',
- ]);
+ 'type' => 'page']);
$node_search_plugin = $this->container->get('plugin.manager.search')->createInstance('node_search');
// Update the search index.
@@ -74,8 +73,7 @@ public function testSearchIndexUpdateOnNodeDeletion() {
$node = $this->drupalCreateNode([
'title' => 'No dragons here',
'body' => [['value' => 'Again: No dragons here']],
- 'type' => 'page',
- ]);
+ 'type' => 'page']);
$node_search_plugin = $this->container->get('plugin.manager.search')->createInstance('node_search');
// Update the search index.
only in patch2:
unchanged:
--- a/core/modules/search/src/Tests/SearchRankingTest.php
+++ b/core/modules/search/src/Tests/SearchRankingTest.php
@@ -53,9 +53,9 @@ public function testRankings() {
foreach ($node_ranks as $node_rank) {
$settings = [
'type' => 'page',
- 'comment' => [
- ['status' => CommentItemInterface::HIDDEN],
- ],
+ 'comment' => [[
+ 'status' => CommentItemInterface::HIDDEN,
+ ]],
'title' => 'Drupal rocks',
'body' => [['value' => "Drupal's search rocks"]],
// Node is one day old.
only in patch2:
unchanged:
--- a/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
+++ b/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php
@@ -78,11 +78,16 @@ protected function setUp() {
// After the third node, we don't care what the settings are. But we
// need to have at least 5 to make sure the throttling is working
// correctly. So, let's make 8 total.
- [],
- [],
- [],
- [],
- [],
+ [
+ ],
+ [
+ ],
+ [
+ ],
+ [
+ ],
+ [
+ ],
];
$this->searchableNodes = [];
foreach ($nodes as $setting) {
only in patch2:
unchanged:
--- a/core/modules/serialization/src/Tests/NormalizerTestBase.php
+++ b/core/modules/serialization/src/Tests/NormalizerTestBase.php
@@ -10,4 +10,4 @@
* @deprecated Scheduled for removal in Drupal 9.0.0.
* Use \Drupal\Tests\serialization\Kernel\NormalizerTestBase instead.
*/
-abstract class NormalizerTestBase extends SerializationNormalizerTestBase {}
+abstract class NormalizerTestBase extends SerializationNormalizerTestBase { }
only in patch2:
unchanged:
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
@@ -7,7 +7,6 @@
use Drupal\block_content\Entity\BlockContentType;
use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationIsClassBlock;
use Drupal\settings_tray_test\Plugin\Block\SettingsTrayFormAnnotationNoneBlock;
-use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait;
use Drupal\user\Entity\Role;
/**
@@ -17,8 +16,6 @@
*/
class SettingsTrayBlockFormTest extends SettingsTrayJavascriptTestBase {
- use ContextualLinkClickTrait;
-
const TOOLBAR_EDIT_LINK_SELECTOR = '#toolbar-bar div.contextual-toolbar-tab button';
const LABEL_INPUT_SELECTOR = 'input[data-drupal-selector="edit-settings-label"]';
@@ -69,151 +66,144 @@ protected function setUp() {
*
* @dataProvider providerTestBlocks
*/
- public function testBlocks($theme, $block_plugin, $new_page_text, $element_selector, $label_selector, $button_text, $toolbar_item) {
+ public function testBlocks($block_plugin, $new_page_text, $element_selector, $label_selector, $button_text, $toolbar_item) {
$web_assert = $this->assertSession();
$page = $this->getSession()->getPage();
- $this->enableTheme($theme);
- $block = $this->placeBlock($block_plugin);
- $block_selector = str_replace('_', '-', $this->getBlockSelector($block));
- $block_id = $block->id();
- $this->drupalGet('user');
+ foreach ($this->getTestThemes() as $theme) {
+ $this->enableTheme($theme);
+ $block = $this->placeBlock($block_plugin);
+ $block_selector = str_replace('_', '-', $this->getBlockSelector($block));
+ $block_id = $block->id();
+ $this->drupalGet('user');
- $link = $page->find('css', "$block_selector .contextual-links li a");
- $this->assertEquals('Quick edit', $link->getText(), "'Quick edit' is the first contextual link for the block.");
- $this->assertContains("/admin/structure/block/manage/$block_id/off-canvas?destination=user/2", $link->getAttribute('href'));
-
- if (isset($toolbar_item)) {
- // Check that you can open a toolbar tray and it will be closed after
- // entering edit mode.
- if ($element = $page->find('css', "#toolbar-administration a.is-active")) {
- // If a tray was open from page load close it.
- $element->click();
- $this->waitForNoElement("#toolbar-administration a.is-active");
+ $link = $page->find('css', "$block_selector .contextual-links li a");
+ $this->assertEquals('Quick edit', $link->getText(), "'Quick edit' is the first contextual link for the block.");
+ $this->assertContains("/admin/structure/block/manage/$block_id/off-canvas?destination=user/2", $link->getAttribute('href'));
+
+ if (isset($toolbar_item)) {
+ // Check that you can open a toolbar tray and it will be closed after
+ // entering edit mode.
+ if ($element = $page->find('css', "#toolbar-administration a.is-active")) {
+ // If a tray was open from page load close it.
+ $element->click();
+ $this->waitForNoElement("#toolbar-administration a.is-active");
+ }
+ $page->find('css', $toolbar_item)->click();
+ $this->assertElementVisibleAfterWait('css', "{$toolbar_item}.is-active");
+ }
+ $this->enableEditMode();
+ if (isset($toolbar_item)) {
+ $this->waitForNoElement("{$toolbar_item}.is-active");
+ }
+ $this->openBlockForm($block_selector);
+ switch ($block_plugin) {
+ case 'system_powered_by_block':
+ // Confirm "Display Title" is not checked.
+ $web_assert->checkboxNotChecked('settings[label_display]');
+ // Confirm Title is not visible.
+ $this->assertEquals($this->isLabelInputVisible(), FALSE, 'Label is not visible');
+ $page->checkField('settings[label_display]');
+ $this->assertEquals($this->isLabelInputVisible(), TRUE, 'Label is visible');
+ // Fill out form, save the form.
+ $page->fillField('settings[label]', $new_page_text);
+
+ break;
+
+ case 'system_branding_block':
+ // Fill out form, save the form.
+ $page->fillField('settings[site_information][site_name]', $new_page_text);
+ break;
+
+ case 'settings_tray_test_class':
+ $web_assert->elementExists('css', '[data-drupal-selector="edit-settings-some-setting"]');
+ break;
}
- $page->find('css', $toolbar_item)->click();
- $this->assertElementVisibleAfterWait('css', "{$toolbar_item}.is-active");
- }
- $this->enableEditMode();
- if (isset($toolbar_item)) {
- $this->waitForNoElement("{$toolbar_item}.is-active");
- }
- $this->openBlockForm($block_selector);
- switch ($block_plugin) {
- case 'system_powered_by_block':
- // Confirm "Display Title" is not checked.
- $web_assert->checkboxNotChecked('settings[label_display]');
- // Confirm Title is not visible.
- $this->assertEquals($this->isLabelInputVisible(), FALSE, 'Label is not visible');
- $page->checkField('settings[label_display]');
- $this->assertEquals($this->isLabelInputVisible(), TRUE, 'Label is visible');
- // Fill out form, save the form.
- $page->fillField('settings[label]', $new_page_text);
-
- break;
-
- case 'system_branding_block':
- // Fill out form, save the form.
- $page->fillField('settings[site_information][site_name]', $new_page_text);
- break;
-
- case 'settings_tray_test_class':
- $web_assert->elementExists('css', '[data-drupal-selector="edit-settings-some-setting"]');
- break;
- }
- if (isset($new_page_text)) {
- $page->pressButton($button_text);
- // Make sure the changes are present.
- $new_page_text_locator = "$block_selector $label_selector:contains($new_page_text)";
- $this->assertElementVisibleAfterWait('css', $new_page_text_locator);
- // The page is loaded with the new change but make sure page is
- // completely loaded.
- $this->assertPageLoadComplete();
- }
+ if (isset($new_page_text)) {
+ $page->pressButton($button_text);
+ // Make sure the changes are present.
+ $new_page_text_locator = "$block_selector $label_selector:contains($new_page_text)";
+ $this->assertElementVisibleAfterWait('css', $new_page_text_locator);
+ $web_assert->assertWaitOnAjaxRequest();
+ }
- $this->openBlockForm($block_selector);
+ $this->openBlockForm($block_selector);
- $this->disableEditMode();
- // Canvas should close when editing module is closed.
- $this->waitForOffCanvasToClose();
+ $this->disableEditMode();
+ // Canvas should close when editing module is closed.
+ $this->waitForOffCanvasToClose();
- $this->enableEditMode();
+ $this->enableEditMode();
- // Open block form by clicking a element inside the block.
- // This confirms that default action for links and form elements is
- // suppressed.
- $this->openBlockForm("$block_selector {$element_selector}", $block_selector);
- $web_assert->elementTextContains('css', '.contextual-toolbar-tab button', 'Editing');
- $web_assert->elementAttributeContains('css', '.dialog-off-canvas__main-canvas', 'class', 'js-settings-tray-edit-mode');
- // Simulate press the Escape key.
- $this->getSession()->executeScript('jQuery("body").trigger(jQuery.Event("keyup", { keyCode: 27 }));');
- $this->waitForOffCanvasToClose();
- $this->getSession()->wait(100);
- $this->assertEditModeDisabled();
- $web_assert->elementTextContains('css', '#drupal-live-announce', 'Exited edit mode.');
- $web_assert->elementTextNotContains('css', '.contextual-toolbar-tab button', 'Editing');
- $web_assert->elementAttributeNotContains('css', '.dialog-off-canvas__main-canvas', 'class', 'js-settings-tray-edit-mode');
+ // Open block form by clicking a element inside the block.
+ // This confirms that default action for links and form elements is
+ // suppressed.
+ $this->openBlockForm("$block_selector {$element_selector}", $block_selector);
+ $web_assert->elementTextContains('css', '.contextual-toolbar-tab button', 'Editing');
+ $web_assert->elementAttributeContains('css', '.dialog-off-canvas__main-canvas', 'class', 'js-settings-tray-edit-mode');
+ // Simulate press the Escape key.
+ $this->getSession()->executeScript('jQuery("body").trigger(jQuery.Event("keyup", { keyCode: 27 }));');
+ $this->waitForOffCanvasToClose();
+ $this->getSession()->wait(100);
+ $this->assertEditModeDisabled();
+ $web_assert->elementTextContains('css', '#drupal-live-announce', 'Exited edit mode.');
+ $web_assert->elementTextNotContains('css', '.contextual-toolbar-tab button', 'Editing');
+ $web_assert->elementAttributeNotContains('css', '.dialog-off-canvas__main-canvas', 'class', 'js-settings-tray-edit-mode');
+ // Delete the block that was placed for the current theme.
+ $block->delete();
+ }
}
/**
* Dataprovider for testBlocks().
*/
public function providerTestBlocks() {
- $blocks = [];
- foreach ($this->getTestThemes() as $theme) {
- $blocks += [
- "$theme: block-powered" => [
- 'theme' => $theme,
- 'block_plugin' => 'system_powered_by_block',
- 'new_page_text' => 'Can you imagine anyone showing the label on this block',
- 'element_selector' => 'span a',
- 'label_selector' => 'h2',
- 'button_text' => 'Save Powered by Drupal',
- 'toolbar_item' => '#toolbar-item-user',
- ],
- "$theme: block-branding" => [
- 'theme' => $theme,
- 'block_plugin' => 'system_branding_block',
- 'new_page_text' => 'The site that will live a very short life',
- 'element_selector' => "a[rel='home']:last-child",
- 'label_selector' => "a[rel='home']:last-child",
- 'button_text' => 'Save Site branding',
- 'toolbar_item' => '#toolbar-item-administration',
- ],
- "$theme: block-search" => [
- 'theme' => $theme,
- 'block_plugin' => 'search_form_block',
- 'new_page_text' => NULL,
- 'element_selector' => '#edit-submit',
- 'label_selector' => 'h2',
- 'button_text' => 'Save Search form',
- 'toolbar_item' => NULL,
- ],
- // This is the functional JS test coverage accompanying
- // \Drupal\Tests\settings_tray\Functional\SettingsTrayTest::testPossibleAnnotations().
- "$theme: " . SettingsTrayFormAnnotationIsClassBlock::class => [
- 'theme' => $theme,
- 'block_plugin' => 'settings_tray_test_class',
- 'new_page_text' => NULL,
- 'element_selector' => 'span',
- 'label_selector' => NULL,
- 'button_text' => NULL,
- 'toolbar_item' => NULL,
- ],
- // This is the functional JS test coverage accompanying
- // \Drupal\Tests\settings_tray\Functional\SettingsTrayTest::testPossibleAnnotations().
- "$theme: " . SettingsTrayFormAnnotationNoneBlock::class => [
- 'theme' => $theme,
- 'block_plugin' => 'settings_tray_test_none',
- 'new_page_text' => NULL,
- 'element_selector' => 'span',
- 'label_selector' => NULL,
- 'button_text' => NULL,
- 'toolbar_item' => NULL,
- ],
- ];
- }
-
+ $blocks = [
+ 'block-powered' => [
+ 'block_plugin' => 'system_powered_by_block',
+ 'new_page_text' => 'Can you imagine anyone showing the label on this block',
+ 'element_selector' => 'span a',
+ 'label_selector' => 'h2',
+ 'button_text' => 'Save Powered by Drupal',
+ 'toolbar_item' => '#toolbar-item-user',
+ ],
+ 'block-branding' => [
+ 'block_plugin' => 'system_branding_block',
+ 'new_page_text' => 'The site that will live a very short life',
+ 'element_selector' => "a[rel='home']:last-child",
+ 'label_selector' => "a[rel='home']:last-child",
+ 'button_text' => 'Save Site branding',
+ 'toolbar_item' => '#toolbar-item-administration',
+ ],
+ 'block-search' => [
+ 'block_plugin' => 'search_form_block',
+ 'new_page_text' => NULL,
+ 'element_selector' => '#edit-submit',
+ 'label_selector' => 'h2',
+ 'button_text' => 'Save Search form',
+ 'toolbar_item' => NULL,
+ ],
+ // This is the functional JS test coverage accompanying
+ // \Drupal\Tests\settings_tray\Functional\SettingsTrayTest::testPossibleAnnotations().
+ SettingsTrayFormAnnotationIsClassBlock::class => [
+ 'block_plugin' => 'settings_tray_test_class',
+ 'new_page_text' => NULL,
+ 'element_selector' => 'span',
+ 'label_selector' => NULL,
+ 'button_text' => NULL,
+ 'toolbar_item' => NULL,
+ ],
+ // This is the functional JS test coverage accompanying
+ // \Drupal\Tests\settings_tray\Functional\SettingsTrayTest::testPossibleAnnotations().
+ SettingsTrayFormAnnotationNoneBlock::class => [
+ 'block_plugin' => 'settings_tray_test_none',
+ 'new_page_text' => NULL,
+ 'element_selector' => 'span',
+ 'label_selector' => NULL,
+ 'button_text' => NULL,
+ 'toolbar_item' => NULL,
+ ],
+ ];
return $blocks;
}
only in patch2:
unchanged:
--- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayJavascriptTestBase.php
+++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayJavascriptTestBase.php
@@ -14,34 +14,12 @@
*/
protected function drupalGet($path, array $options = [], array $headers = []) {
$return = parent::drupalGet($path, $options, $headers);
- $this->assertPageLoadComplete();
- return $return;
- }
- /**
- * Assert the page is completely loaded.
- *
- * Ajax requests may happen after page loads. Also for users who have access
- * to contextual links the contextual link placeholders will be filled after
- * the page is received.
- */
- protected function assertPageLoadComplete() {
+ // After the page loaded we need to additionally wait until the settings
+ // tray Ajax activity is done.
$this->assertSession()->assertWaitOnAjaxRequest();
- if ($this->loggedInUser && $this->loggedInUser->hasPermission('access contextual links')) {
- $this->assertAllContextualLinksLoaded();
- }
- }
- /**
- * Assert all contextual link areas have be loaded.
- *
- * Contextual link placeholders will be filled after
- * the page is received.
- *
- * @todo Move this function to https://www.drupal.org/node/2821724.
- */
- protected function assertAllContextualLinksLoaded() {
- $this->waitForNoElement('[data-contextual-id]:empty');
+ return $return;
}
/**
@@ -94,11 +72,53 @@ protected function getTray() {
* (optional) Timeout in milliseconds, defaults to 10000.
*/
protected function waitForNoElement($selector, $timeout = 10000) {
- $condition = "(typeof jQuery !== 'undefined' && jQuery('$selector').length === 0)";
+ $condition = "(jQuery('$selector').length == 0)";
$this->assertJsCondition($condition, $timeout);
}
/**
+ * Clicks a contextual link.
+ *
+ * @todo Remove this function when related trait added in
+ * https://www.drupal.org/node/2821724.
+ *
+ * @param string $selector
+ * The selector for the element that contains the contextual link.
+ * @param string $link_locator
+ * The link id, title, or text.
+ * @param bool $force_visible
+ * If true then the button will be forced to visible so it can be clicked.
+ */
+ protected function clickContextualLink($selector, $link_locator, $force_visible = TRUE) {
+ if ($force_visible) {
+ $this->toggleContextualTriggerVisibility($selector);
+ }
+
+ $element = $this->getSession()->getPage()->find('css', $selector);
+ $element->find('css', '.contextual button')->press();
+ $element->findLink($link_locator)->click();
+
+ if ($force_visible) {
+ $this->toggleContextualTriggerVisibility($selector);
+ }
+ }
+
+ /**
+ * Toggles the visibility of a contextual trigger.
+ *
+ * @todo Remove this function when related trait added in
+ * https://www.drupal.org/node/2821724.
+ *
+ * @param string $selector
+ * The selector for the element that contains the contextual link.
+ */
+ protected function toggleContextualTriggerVisibility($selector) {
+ // Hovering over the element itself with should be enough, but does not
+ // work. Manually remove the visually-hidden class.
+ $this->getSession()->executeScript("jQuery('{$selector} .contextual .trigger').toggleClass('visually-hidden');");
+ }
+
+ /**
* Get themes to test.
*
* @return string[]
only in patch2:
unchanged:
--- a/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
@@ -1,6 +1,6 @@
drupalLogin($this->drupalCreateUser(['access toolbar', 'access shortcuts', 'access content overview', 'administer content types']));
$this->drupalGet(Url::fromRoute(''));
$shortcuts = $this->cssSelect('#toolbar-item-shortcuts-tray .toolbar-menu a');
- $this->assertEqual($shortcuts[0]->getText(), 'Add content');
- $this->assertEqual($shortcuts[1]->getText(), 'All content');
+ $this->assertEqual((string) $shortcuts[0], 'Add content');
+ $this->assertEqual((string) $shortcuts[1], 'All content');
foreach ($this->set->getShortcuts() as $shortcut) {
$shortcut->setWeight($shortcut->getWeight() * -1)->save();
}
$this->drupalGet(Url::fromRoute(''));
$shortcuts = $this->cssSelect('#toolbar-item-shortcuts-tray .toolbar-menu a');
- $this->assertEqual($shortcuts[0]->getText(), 'All content');
- $this->assertEqual($shortcuts[1]->getText(), 'Add content');
+ $this->assertEqual((string) $shortcuts[0], 'All content');
+ $this->assertEqual((string) $shortcuts[1], 'Add content');
}
/**
only in patch2:
unchanged:
--- a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
@@ -1,6 +1,6 @@
$element) {
- $this->assertEqual($element->getText(), $expected_items[$key]);
+ $this->assertEqual((string) $element[0], $expected_items[$key]);
}
// Look for test shortcuts in the table.
only in patch2:
unchanged:
--- a/core/modules/shortcut/src/Tests/ShortcutTestBase.php
+++ b/core/modules/shortcut/src/Tests/ShortcutTestBase.php
@@ -2,8 +2,6 @@
namespace Drupal\shortcut\Tests;
-@trigger_error(__NAMESPACE__ . '\ShortcutTestBase is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\shortcut\Functional\ShortcutTestBase, see https://www.drupal.org/node/2906736.', E_USER_DEPRECATED);
-
use Drupal\shortcut\Entity\Shortcut;
use Drupal\shortcut\Entity\ShortcutSet;
use Drupal\shortcut\ShortcutSetInterface;
@@ -11,11 +9,6 @@
/**
* Defines base class for shortcut test cases.
- *
- * @deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
- * Use \Drupal\Tests\shortcut\Functional\ShortcutTestBase.
- *
- * @see https://www.drupal.org/node/2906736
*/
abstract class ShortcutTestBase extends WebTestBase {
only in patch2:
unchanged:
--- a/core/modules/shortcut/tests/src/Functional/ShortcutTranslationUITest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php
@@ -1,6 +1,6 @@
profile != 'standard') {
- // Create Basic page and Article node types.
- $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
- $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
-
- // Populate the default shortcut set.
- $shortcut = Shortcut::create([
- 'shortcut_set' => 'default',
- 'title' => t('Add content'),
- 'weight' => -20,
- 'link' => [
- 'uri' => 'internal:/node/add',
- ],
- ]);
- $shortcut->save();
-
- $shortcut = Shortcut::create([
- 'shortcut_set' => 'default',
- 'title' => t('All content'),
- 'weight' => -19,
- 'link' => [
- 'uri' => 'internal:/admin/content',
- ],
- ]);
- $shortcut->save();
- }
-
- // Create users.
- $this->adminUser = $this->drupalCreateUser(['access toolbar', 'administer shortcuts', 'view the administration theme', 'create article content', 'create page content', 'access content overview', 'administer users', 'link to any page', 'edit any article content']);
- $this->shortcutUser = $this->drupalCreateUser(['customize shortcut links', 'switch shortcut sets', 'access shortcuts', 'access content']);
-
- // Create a node.
- $this->node = $this->drupalCreateNode(['type' => 'article']);
-
- // Log in as admin and grab the default shortcut set.
- $this->drupalLogin($this->adminUser);
- $this->set = ShortcutSet::load('default');
- \Drupal::entityManager()->getStorage('shortcut_set')->assignUser($this->set, $this->adminUser);
- }
-
- /**
- * Creates a generic shortcut set.
- */
- public function generateShortcutSet($label = '', $id = NULL) {
- $set = ShortcutSet::create([
- 'id' => isset($id) ? $id : strtolower($this->randomMachineName()),
- 'label' => empty($label) ? $this->randomString() : $label,
- ]);
- $set->save();
- return $set;
- }
-
- /**
- * Extracts information from shortcut set links.
- *
- * @param \Drupal\shortcut\ShortcutSetInterface $set
- * The shortcut set object to extract information from.
- * @param string $key
- * The array key indicating what information to extract from each link:
- * - 'title': Extract shortcut titles.
- * - 'link': Extract shortcut paths.
- * - 'id': Extract the shortcut ID.
- *
- * @return array
- * Array of the requested information from each link.
- */
- public function getShortcutInformation(ShortcutSetInterface $set, $key) {
- $info = [];
- \Drupal::entityManager()->getStorage('shortcut')->resetCache();
- foreach ($set->getShortcuts() as $shortcut) {
- if ($key == 'link') {
- $info[] = $shortcut->link->uri;
- }
- else {
- $info[] = $shortcut->{$key}->value;
- }
- }
- return $info;
- }
-
-}
only in patch2:
unchanged:
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -363,7 +363,7 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun
// exec in a subshell so that the environment is isolated when running tests
// via the simpletest UI.
- $ret = exec(implode(" ", $command), $output, $status);
+ $ret = exec(join($command, " "), $output, $status);
chdir($old_cwd);
putenv('SIMPLETEST_DB=');
only in patch2:
unchanged:
--- a/core/modules/simpletest/src/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php
@@ -175,7 +175,7 @@ public function stubTest() {
// along by the rethrow.
assert(FALSE, 'Lorem Ipsum');
}
- catch (\AssertionError $e ) {
+ catch ( \AssertionError $e ) {
$this->assertEqual($e->getMessage(), 'Lorem Ipsum', 'Runtime assertions Enabled and running.');
}
}
only in patch2:
unchanged:
--- a/core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php
+++ b/core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php
@@ -348,7 +348,8 @@ public function testGetTestClassesWithSelectedTypes() {
$result = $test_discovery->getTestClasses(NULL, ['PHPUnit-Kernel']);
$this->assertCount(2, $result);
$this->assertEquals([
- 'example' => [],
+ 'example' => [
+ ],
'example2' => [
'Drupal\Tests\test_module\Kernel\KernelExampleTest3' => [
'name' => 'Drupal\Tests\test_module\Kernel\KernelExampleTest3',
only in patch2:
unchanged:
--- a/core/modules/statistics/src/NodeStatisticsDatabaseStorage.php
+++ b/core/modules/statistics/src/NodeStatisticsDatabaseStorage.php
@@ -131,7 +131,7 @@ public function resetDayCount() {
public function maxTotalCount() {
$query = $this->connection->select('node_counter', 'nc');
$query->addExpression('MAX(totalcount)');
- $max_total_count = (int) $query->execute()->fetchField();
+ $max_total_count = (int)$query->execute()->fetchField();
return $max_total_count;
}
only in patch2:
unchanged:
--- a/core/modules/system/src/Form/DateFormatDeleteForm.php
+++ b/core/modules/system/src/Form/DateFormatDeleteForm.php
@@ -43,8 +43,8 @@ public static function create(ContainerInterface $container) {
public function getQuestion() {
return t('Are you sure you want to delete the format %name : %format?', [
'%name' => $this->entity->label(),
- '%format' => $this->dateFormatter->format(REQUEST_TIME, $this->entity->id()),
- ]);
+ '%format' => $this->dateFormatter->format(REQUEST_TIME, $this->entity->id())]
+ );
}
}
only in patch2:
unchanged:
--- a/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php
+++ b/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php
@@ -45,7 +45,7 @@ protected function validateArguments(array $arguments) {
// Validate or set background color argument.
if (!empty($arguments['background'])) {
// Validate the background color: Color::hexToRgb does so for us.
- $background = Color::hexToRgb($arguments['background']) + ['alpha' => 0 ];
+ $background = Color::hexToRgb($arguments['background']) + [ 'alpha' => 0 ];
}
else {
// Background color is not specified: use transparent white as background.
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/Ajax/DialogTest.php
+++ b/core/modules/system/src/Tests/Ajax/DialogTest.php
@@ -175,12 +175,10 @@ public function testDialog() {
'edit-preview' => [
'callback' => '::preview',
'event' => 'click',
- 'url' => Url::fromRoute('ajax_test.dialog_form', [], [
- 'query' => [
+ 'url' => Url::fromRoute('ajax_test.dialog_form', [], ['query' => [
MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_modal',
FormBuilderInterface::AJAX_FORM_REQUEST => TRUE,
- ],
- ])->toString(),
+ ]])->toString(),
'dialogType' => 'ajax',
'submit' => [
'_triggering_element_name' => 'op',
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/Database/FakeRecord.php
+++ b/core/modules/system/src/Tests/Database/FakeRecord.php
@@ -14,4 +14,4 @@
* @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead
* use \Drupal\Tests\system\Functional\Database\FakeRecord.
*/
-class FakeRecord {}
+class FakeRecord { }
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
+++ b/core/modules/system/src/Tests/Form/ElementsTableSelectTest.php
@@ -93,7 +93,7 @@ public function testTableselectColSpan() {
// The first two body rows should each have 5 table cells: One for the
// radio, one cell in the first column, one cell in the second column,
// and two cells in the third column which has colspan 2.
- for ($i = 0; $i <= 1; $i++) {
+ for ( $i = 0; $i <= 1; $i++) {
$this->assertEqual(count($table_body[0]->tr[$i]->td), 5, format_string('There are five cells in row @row.', ['@row' => $i]));
}
// The third row should have 3 cells, one for the radio, one spanning the
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/System/FloodTest.php
+++ b/core/modules/system/src/Tests/System/FloodTest.php
@@ -34,9 +34,8 @@ public function testCleanUp() {
$window_expired = -1;
$name = 'flood_test_cleanup';
- $flood = \Drupal::flood();
- $this->assertTrue($flood->isAllowed($name, $threshold));
// Register expired event.
+ $flood = \Drupal::flood();
$flood->register($name, $window_expired);
// Verify event is not allowed.
$this->assertFalse($flood->isAllowed($name, $threshold));
@@ -63,7 +62,6 @@ public function testMemoryBackend() {
$request_stack = \Drupal::service('request_stack');
$flood = new MemoryBackend($request_stack);
- $this->assertTrue($flood->isAllowed($name, $threshold));
// Register expired event.
$flood->register($name, $window_expired);
// Verify event is not allowed.
@@ -92,7 +90,6 @@ public function testDatabaseBackend() {
$connection = \Drupal::service('database');
$request_stack = \Drupal::service('request_stack');
$flood = new DatabaseBackend($connection, $request_stack);
- $this->assertTrue($flood->isAllowed($name, $threshold));
// Register expired event.
$flood->register($name, $window_expired);
// Verify event is not allowed.
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/System/PageTitleTest.php
+++ b/core/modules/system/src/Tests/System/PageTitleTest.php
@@ -113,9 +113,9 @@ public function testRoutingTitle() {
$this->assertEqual('Test dynamic title', (string) $result[0]);
// Set some custom translated strings.
- $this->addCustomTranslations('en', [
- '' => ['Static title' => 'Static title translated'],
- ]);
+ $this->addCustomTranslations('en', ['' => [
+ 'Static title' => 'Static title translated'
+ ]]);
$this->writeCustomTranslations();
// Ensure that the title got translated.
only in patch2:
unchanged:
--- a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
+++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
@@ -243,14 +243,10 @@ protected function runUpdates() {
}
// The site might be broken at the time so logging in using the UI might
// not work, so we use the API itself.
- drupal_rewrite_settings([
- 'settings' => [
- 'update_free_access' => (object) [
- 'value' => TRUE,
- 'required' => TRUE,
- ],
- ],
- ]);
+ drupal_rewrite_settings(['settings' => ['update_free_access' => (object) [
+ 'value' => TRUE,
+ 'required' => TRUE,
+ ]]]);
$this->drupalGet($this->updateUrl);
$this->clickLink(t('Continue'));
only in patch2:
unchanged:
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -897,7 +897,7 @@ function system_requirements($phase) {
$requirements['trusted_host_patterns'] = [
'title' => t('Trusted Host Settings'),
'value' => t('Enabled'),
- 'description' => t('The trusted_host_patterns setting is set to allow %trusted_host_patterns', ['%trusted_host_patterns' => implode(', ', $trusted_host_patterns)]),
+ 'description' => t('The trusted_host_patterns setting is set to allow %trusted_host_patterns', ['%trusted_host_patterns' => join(', ', $trusted_host_patterns)]),
];
}
}
only in patch2:
unchanged:
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1383,7 +1383,7 @@ function system_time_zones($blank = NULL, $grouped = FALSE) {
$city = array_pop($split);
$region = array_shift($split);
if (!empty($region)) {
- $grouped_zones[$region][$key] = empty($split) ? $city : $city . ' (' . implode('/', $split) . ')';
+ $grouped_zones[$region][$key] = empty($split) ? $city : $city . ' (' . join('/', $split) . ')';
}
else {
$grouped_zones[$key] = $value;
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php
+++ b/core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestSimpleForm.php
@@ -31,8 +31,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#options' => [
'red' => 'red',
'green' => 'green',
- 'blue' => 'blue',
- ],
+ 'blue' => 'blue'],
'#ajax' => [
'callback' => [$object, 'selectCallback'],
],
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/database_test/database_test.install
+++ b/core/modules/system/tests/modules/database_test/database_test.install
@@ -207,8 +207,7 @@ function database_test_schema() {
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
- 'default' => 0,
- ],
+ 'default' => 0],
],
'primary key' => ['id'],
'unique keys' => [
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/database_test/src/Controller/DatabaseTestController.php
+++ b/core/modules/system/tests/modules/database_test/src/Controller/DatabaseTestController.php
@@ -91,7 +91,7 @@ public function testTablesort() {
'tid' => ['data' => t('Task ID'), 'field' => 'tid', 'sort' => 'desc'],
'pid' => ['data' => t('Person ID'), 'field' => 'pid'],
'task' => ['data' => t('Task'), 'field' => 'task'],
- 'priority' => ['data' => t('Priority'), 'field' => 'priority'],
+ 'priority' => ['data' => t('Priority'), 'field' => 'priority', ],
];
$query = db_select('test_task', 't');
@@ -123,7 +123,7 @@ public function testTablesortFirst() {
'tid' => ['data' => t('Task ID'), 'field' => 'tid', 'sort' => 'desc'],
'pid' => ['data' => t('Person ID'), 'field' => 'pid'],
'task' => ['data' => t('Task'), 'field' => 'task'],
- 'priority' => ['data' => t('Priority'), 'field' => 'priority'],
+ 'priority' => ['data' => t('Priority'), 'field' => 'priority', ],
];
$query = db_select('test_task', 't');
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/early_rendering_controller_test/src/EarlyRenderingTestController.php
+++ b/core/modules/system/tests/modules/early_rendering_controller_test/src/EarlyRenderingTestController.php
@@ -62,8 +62,7 @@ public function renderArray() {
'#pre_render' => [function () {
$elements = $this->earlyRenderContent();
return $elements;
- }
- ],
+ }],
];
}
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/early_rendering_controller_test/src/TestDomainObject.php
+++ b/core/modules/system/tests/modules/early_rendering_controller_test/src/TestDomainObject.php
@@ -2,4 +2,4 @@
namespace Drupal\early_rendering_controller_test;
-class TestDomainObject {}
+class TestDomainObject { }
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/entity_test_update/entity_test_update.module
+++ b/core/modules/system/tests/modules/entity_test_update/entity_test_update.module
@@ -103,15 +103,13 @@ function _entity_test_update_create_test_entities($start = 1, $end = 50, $add_tr
'id' => $i,
'name' => $i,
'test_single_property' => $i . ' - test single property',
- 'test_multiple_properties' => [
- [
- 'value1' => $i . ' - test multiple properties - value1',
- 'value2' => $i . ' - test multiple properties - value2',
- ],
- ],
+ 'test_multiple_properties' => [[
+ 'value1' => $i . ' - test multiple properties - value1',
+ 'value2' => $i . ' - test multiple properties - value2',
+ ]],
'test_single_property_multiple_values' => [
['value' => $i . ' - test single property multiple values 0'],
- ['value' => $i . ' - test single property multiple values 1'],
+ ['value' => $i . ' - test single property multiple values 1']
],
'test_multiple_properties_multiple_values' => [
[
@@ -121,7 +119,7 @@ function _entity_test_update_create_test_entities($start = 1, $end = 50, $add_tr
[
'value1' => $i . ' - test multiple properties multiple values - value1 1',
'value2' => $i . ' - test multiple properties multiple values - value2 1',
- ],
+ ]
],
'test_non_rev_field' => $i . ' - test non-revisionable field',
'test_non_mul_field' => $i . ' - test non-translatable field',
@@ -134,7 +132,7 @@ function _entity_test_update_create_test_entities($start = 1, $end = 50, $add_tr
[
'value1' => $i . ' - field test configurable field - value1 1',
'value2' => $i . ' - field test configurable field - value2 1',
- ],
+ ]
],
'test_entity_base_field_info' => $i . ' - test entity base field info',
]);
@@ -143,15 +141,13 @@ function _entity_test_update_create_test_entities($start = 1, $end = 50, $add_tr
$entity->addTranslation('ro', [
'name' => $i . ' - ro',
'test_single_property' => $i . ' - test single property - ro',
- 'test_multiple_properties' => [
- [
- 'value1' => $i . ' - test multiple properties - value1 - ro',
- 'value2' => $i . ' - test multiple properties - value2 - ro',
- ],
- ],
+ 'test_multiple_properties' => [[
+ 'value1' => $i . ' - test multiple properties - value1 - ro',
+ 'value2' => $i . ' - test multiple properties - value2 - ro',
+ ]],
'test_single_property_multiple_values' => [
['value' => $i . ' - test single property multiple values 0 - ro'],
- ['value' => $i . ' - test single property multiple values 1 - ro'],
+ ['value' => $i . ' - test single property multiple values 1 - ro']
],
'test_multiple_properties_multiple_values' => [
[
@@ -161,7 +157,7 @@ function _entity_test_update_create_test_entities($start = 1, $end = 50, $add_tr
[
'value1' => $i . ' - test multiple properties multiple values - value1 1 - ro',
'value2' => $i . ' - test multiple properties multiple values - value2 1 - ro',
- ],
+ ]
],
'test_non_rev_field' => $i . ' - test non-revisionable field - ro',
'field_test_configurable_field' => [
@@ -172,7 +168,7 @@ function _entity_test_update_create_test_entities($start = 1, $end = 50, $add_tr
[
'value1' => $i . ' - field test configurable field - value1 1 - ro',
'value2' => $i . ' - field test configurable field - value2 1 - ro',
- ],
+ ]
],
'test_entity_base_field_info' => $i . ' - test entity base field info - ro',
]);
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestSelectForm.php
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestSelectForm.php
@@ -115,14 +115,6 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#multiple' => TRUE,
];
- $form['opt_groups'] = [
- '#type' => 'select',
- '#options' => [
- 'optgroup_one' => ['one' => 'one', 'two' => 'two', 'three' => 'three', 'four' => 'four'],
- 'optgroup_two' => ['five' => 'five', 'six' => 'six'],
- ],
- ];
-
$form['submit'] = ['#type' => 'submit', '#value' => 'Submit'];
return $form;
}
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/DerivedToolkit.php
+++ b/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/DerivedToolkit.php
@@ -10,4 +10,4 @@
* title = @Translation("A dummy toolkit, derivative of 'test'.")
* )
*/
-class DerivedToolkit extends TestToolkit {}
+class DerivedToolkit extends TestToolkit { }
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/Bar.php
+++ b/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/Bar.php
@@ -13,4 +13,4 @@
* description = @Translation("Bar.")
* )
*/
-class Bar extends OperationBase {}
+class Bar extends OperationBase { }
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/Foo.php
+++ b/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/Foo.php
@@ -13,4 +13,4 @@
* description = @Translation("Foo.")
* )
*/
-class Foo extends OperationBase {}
+class Foo extends OperationBase { }
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/FooDerived.php
+++ b/core/modules/system/tests/modules/image_test/src/Plugin/ImageToolkit/Operation/test/FooDerived.php
@@ -13,4 +13,4 @@
* description = @Translation("Foo derived.")
* )
*/
-class FooDerived extends OperationBase {}
+class FooDerived extends OperationBase { }
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.module
+++ b/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.module
@@ -14,6 +14,5 @@ function keyvalue_test_entity_type_alter(array &$entity_types) {
$entity_types['entity_test_label']->setStorageClass('Drupal\Core\Entity\KeyValueStore\KeyValueContentEntityStorage');
$entity_keys = $entity_types['entity_test_label']->getKeys();
$entity_types['entity_test_label']->set('entity_keys', $entity_keys + ['uuid' => 'uuid']);
- $entity_types['entity_test_label']->set('provider', 'keyvalue_test');
}
}
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/ExtendingNonInstalledClass.php
+++ b/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/ExtendingNonInstalledClass.php
@@ -11,4 +11,4 @@
* color = "pink",
* )
*/
-class ExtendingNonInstalledClass extends YummyFruit {}
+class ExtendingNonInstalledClass extends YummyFruit { }
only in patch2:
unchanged:
--- a/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/FruitInterface.php
+++ b/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/FruitInterface.php
@@ -5,4 +5,4 @@
/**
* Provides an interface for test plugins.
*/
-interface FruitInterface {}
+interface FruitInterface { }
only in patch2:
unchanged:
--- a/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php
@@ -66,11 +66,11 @@ public function testStylesheets() {
// should work nevertheless.
$this->drupalGet('theme-test/info/stylesheets');
- $this->assertIdentical(1, count($this->xpath('//link[contains(@href, :href)]', [':href' => "$base/base-add.css"])), "$base/base-add.css found");
- $this->assertIdentical(0, count($this->xpath('//link[contains(@href, :href)]', [':href' => "base-remove.css"])), "base-remove.css not found");
+ $this->assertIdentical(1, count($this->xpath('//link[contains(@href, :href)]', [':href' => "$base/base-add.css"])), "$base/base-add.css found");
+ $this->assertIdentical(0, count($this->xpath('//link[contains(@href, :href)]', [':href' => "base-remove.css"])), "base-remove.css not found");
- $this->assertIdentical(1, count($this->xpath('//link[contains(@href, :href)]', [':href' => "$sub/sub-add.css"])), "$sub/sub-add.css found");
- $this->assertIdentical(0, count($this->xpath('//link[contains(@href, :href)]', [':href' => "sub-remove.css"])), "sub-remove.css not found");
+ $this->assertIdentical(1, count($this->xpath('//link[contains(@href, :href)]', [':href' => "$sub/sub-add.css"])), "$sub/sub-add.css found");
+ $this->assertIdentical(0, count($this->xpath('//link[contains(@href, :href)]', [':href' => "sub-remove.css"])), "sub-remove.css not found");
$this->assertIdentical(0, count($this->xpath('//link[contains(@href, :href)]', [':href' => "base-add.sub-remove.css"])), "base-add.sub-remove.css not found");
// Verify that CSS files with the same name are loaded from both the base theme and subtheme.
only in patch2:
unchanged:
--- a/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
+++ b/core/modules/system/tests/src/Unit/Menu/SystemLocalTasksTest.php
@@ -61,13 +61,10 @@ public function testSystemAdminLocalTasks($route, $expected) {
public function getSystemAdminRoutes() {
return [
['system.admin_content', [['system.admin_content']]],
- [
- 'system.theme_settings_theme',
- [
- ['system.themes_page', 'system.theme_settings'],
- ['system.theme_settings_global', 'system.theme_settings_theme:bartik'],
- ],
- ],
+ ['system.theme_settings_theme', [
+ ['system.themes_page', 'system.theme_settings'],
+ ['system.theme_settings_global', 'system.theme_settings_theme:bartik'],
+ ]],
];
}
only in patch2:
unchanged:
--- a/core/modules/system/tests/themes/test_theme/src/ThemeClass.php
+++ b/core/modules/system/tests/themes/test_theme/src/ThemeClass.php
@@ -5,4 +5,4 @@
/**
* Represents a random class, used to test if themes can provide classes.
*/
-class ThemeClass {}
+class ThemeClass { }
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepthModifier.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepthModifier.php
@@ -17,9 +17,9 @@
*/
class IndexTidDepthModifier extends ArgumentPluginBase {
- public function buildOptionsForm(&$form, FormStateInterface $form_state) {}
+ public function buildOptionsForm(&$form, FormStateInterface $form_state) { }
- public function query($group_by = FALSE) {}
+ public function query($group_by = FALSE) { }
public function preQuery() {
// We don't know our argument yet, but it's based upon our position:
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
@@ -116,7 +116,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
];
$form['node'] = [
'#type' => 'checkbox',
- '#title' => $this->t("Load default filter from node page, that's good for related taxonomy blocks"),
+ '#title' => $this->t('Load default filter from node page, that\'s good for related taxonomy blocks'),
'#default_value' => $this->options['node'],
];
only in patch2:
unchanged:
--- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
+++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
@@ -82,9 +82,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
}
}
- public function hasExtraOptions() {
- return TRUE;
- }
+ public function hasExtraOptions() { return TRUE; }
/**
* {@inheritdoc}
only in patch2:
unchanged:
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -61,7 +61,7 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) {
$output .= '
' . t('Classifying entity content') . '
';
$output .= '
' . t('A user with the Administer fields permission for a certain entity type may add Taxonomy term reference fields to the entity type, which will allow entities to be classified using taxonomy terms. See the Entity Reference help for more information about reference fields. See the Field module help and the Field UI help pages for general information on fields and how to create and manage them.', [':field_ui' => $field_ui_url, ':field' => \Drupal::url('help.page', ['name' => 'field']), ':entity_reference' => \Drupal::url('help.page', ['name' => 'entity_reference'])]) . '
';
$output .= '
' . t('Adding new terms during content creation') . '
';
- $output .= '
' . t("Allowing users to add new terms gradually builds a vocabulary as content is added and edited. Users can add new terms if either of the two Autocomplete widgets is chosen for the Taxonomy term reference field in the Manage form display page for the field. You will also need to enable the Create referenced entities if they don't already exist option, and restrict the field to one vocabulary.") . '
';
+ $output .= '
' . t('Allowing users to add new terms gradually builds a vocabulary as content is added and edited. Users can add new terms if either of the two Autocomplete widgets is chosen for the Taxonomy term reference field in the Manage form display page for the field. You will also need to enable the Create referenced entities if they don\'t already exist option, and restrict the field to one vocabulary.') . '
';
$output .= '
' . t('Configuring displays and form displays') . '
';
$output .= '
' . t('See the Entity Reference help page for the field widgets and formatters that can be configured for any reference field on the Manage display and Manage form display pages. Taxonomy additionally provides an RSS category formatter that displays nothing when the entity item is displayed as HTML, but displays an RSS category instead of a list when the entity item is displayed in an RSS feed.', [':entity_reference' => \Drupal::url('help.page', ['name' => 'entity_reference'])]) . '';
$output .= '';
only in patch2:
unchanged:
--- a/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
@@ -74,12 +74,10 @@ protected function setUpNode() {
$node = Node::create([
'title' => $this->randomMachineName(),
'type' => 'article',
- 'description' => [
- [
- 'value' => $this->randomMachineName(),
- 'format' => 'basic_html',
- ],
- ],
+ 'description' => [[
+ 'value' => $this->randomMachineName(),
+ 'format' => 'basic_html'
+ ]],
$this->termFieldName => [['target_id' => $this->term->id()]],
'langcode' => $this->baseLangcode,
]);
only in patch2:
unchanged:
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
@@ -77,7 +77,7 @@ public function testVocabularyInterface() {
$this->drupalPostForm('admin/structure/taxonomy/add', $edit, t('Save'));
$site_name = $this->config('system.site')->get('name');
- $this->assertTitle(t("Don't Panic | @site-name", ['@site-name' => $site_name]), 'The page title contains the escaped character.');
+ $this->assertTitle(t('Don\'t Panic | @site-name', ['@site-name' => $site_name]), 'The page title contains the escaped character.');
}
/**
only in patch2:
unchanged:
--- a/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermKernelTest.php
@@ -18,7 +18,7 @@ class TermKernelTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
- public static $modules = ['filter', 'taxonomy', 'text', 'user' ];
+ public static $modules = [ 'filter', 'taxonomy', 'text', 'user' ];
/**
* {@inheritdoc}
only in patch2:
unchanged:
--- a/core/modules/text/src/Plugin/Field/FieldFormatter/TextSummaryOrTrimmedFormatter.php
+++ b/core/modules/text/src/Plugin/Field/FieldFormatter/TextSummaryOrTrimmedFormatter.php
@@ -16,4 +16,4 @@
* }
* )
*/
-class TextSummaryOrTrimmedFormatter extends TextTrimmedFormatter {}
+class TextSummaryOrTrimmedFormatter extends TextTrimmedFormatter { }
only in patch2:
unchanged:
--- a/core/modules/text/tests/src/Unit/Migrate/TextCckTest.php
+++ b/core/modules/text/tests/src/Unit/Migrate/TextCckTest.php
@@ -123,33 +123,37 @@ public function testProcessBooleanTextExplicitValues() {
*/
public function getFieldTypeProvider() {
return [
- ['string_long', 'text_textfield', ['text_processing' => FALSE]],
+ ['string_long', 'text_textfield', [
+ 'text_processing' => FALSE,
+ ]],
['string', 'text_textfield', [
- 'text_processing' => FALSE,
- 'max_length' => 128,
- ],
- ],
+ 'text_processing' => FALSE,
+ 'max_length' => 128,
+ ]],
['string_long', 'text_textfield', [
- 'text_processing' => FALSE,
- 'max_length' => 4096,
- ],
- ],
- ['text_long', 'text_textfield', ['text_processing' => TRUE]],
+ 'text_processing' => FALSE,
+ 'max_length' => 4096,
+ ]],
+ ['text_long', 'text_textfield', [
+ 'text_processing' => TRUE,
+ ]],
['text', 'text_textfield', [
- 'text_processing' => TRUE,
- 'max_length' => 128,
- ],
- ],
+ 'text_processing' => TRUE,
+ 'max_length' => 128,
+ ]],
['text_long', 'text_textfield', [
- 'text_processing' => TRUE,
- 'max_length' => 4096,
- ],
- ],
+ 'text_processing' => TRUE,
+ 'max_length' => 4096,
+ ]],
['list_string', 'optionwidgets_buttons'],
['list_string', 'optionwidgets_select'],
['boolean', 'optionwidgets_onoff'],
- ['text_long', 'text_textarea', ['text_processing' => TRUE]],
- ['string_long', 'text_textarea', ['text_processing' => FALSE]],
+ ['text_long', 'text_textarea', [
+ 'text_processing' => TRUE,
+ ]],
+ ['string_long', 'text_textarea', [
+ 'text_processing' => FALSE,
+ ]],
[NULL, 'undefined'],
];
}
only in patch2:
unchanged:
--- a/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
+++ b/core/modules/text/tests/src/Unit/Migrate/d6/TextFieldTest.php
@@ -123,33 +123,37 @@ public function testProcessBooleanTextExplicitValues() {
*/
public function getFieldTypeProvider() {
return [
- ['string_long', 'text_textfield', ['text_processing' => FALSE]],
+ ['string_long', 'text_textfield', [
+ 'text_processing' => FALSE,
+ ]],
['string', 'text_textfield', [
- 'text_processing' => FALSE,
- 'max_length' => 128,
- ],
- ],
+ 'text_processing' => FALSE,
+ 'max_length' => 128,
+ ]],
['string_long', 'text_textfield', [
- 'text_processing' => FALSE,
- 'max_length' => 4096,
- ],
- ],
- ['text_long', 'text_textfield', ['text_processing' => TRUE]],
+ 'text_processing' => FALSE,
+ 'max_length' => 4096,
+ ]],
+ ['text_long', 'text_textfield', [
+ 'text_processing' => TRUE,
+ ]],
['text', 'text_textfield', [
- 'text_processing' => TRUE,
- 'max_length' => 128,
- ],
- ],
+ 'text_processing' => TRUE,
+ 'max_length' => 128,
+ ]],
['text_long', 'text_textfield', [
- 'text_processing' => TRUE,
- 'max_length' => 4096,
- ],
- ],
+ 'text_processing' => TRUE,
+ 'max_length' => 4096,
+ ]],
['list_string', 'optionwidgets_buttons'],
['list_string', 'optionwidgets_select'],
['boolean', 'optionwidgets_onoff'],
- ['text_long', 'text_textarea', ['text_processing' => TRUE]],
- ['string_long', 'text_textarea', ['text_processing' => FALSE]],
+ ['text_long', 'text_textarea', [
+ 'text_processing' => TRUE,
+ ]],
+ ['string_long', 'text_textarea', [
+ 'text_processing' => FALSE,
+ ]],
[NULL, 'undefined'],
];
}
only in patch2:
unchanged:
--- a/core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php
+++ b/core/modules/text/tests/src/Unit/Plugin/migrate/cckfield/TextCckTest.php
@@ -123,33 +123,37 @@ public function testProcessBooleanTextExplicitValues() {
*/
public function getFieldTypeProvider() {
return [
- ['string_long', 'text_textfield', ['text_processing' => FALSE]],
+ ['string_long', 'text_textfield', [
+ 'text_processing' => FALSE,
+ ]],
['string', 'text_textfield', [
- 'text_processing' => FALSE,
- 'max_length' => 128,
- ],
- ],
+ 'text_processing' => FALSE,
+ 'max_length' => 128,
+ ]],
['string_long', 'text_textfield', [
- 'text_processing' => FALSE,
- 'max_length' => 4096,
- ],
- ],
- ['text_long', 'text_textfield', ['text_processing' => TRUE]],
+ 'text_processing' => FALSE,
+ 'max_length' => 4096,
+ ]],
+ ['text_long', 'text_textfield', [
+ 'text_processing' => TRUE,
+ ]],
['text', 'text_textfield', [
- 'text_processing' => TRUE,
- 'max_length' => 128,
- ],
- ],
+ 'text_processing' => TRUE,
+ 'max_length' => 128,
+ ]],
['text_long', 'text_textfield', [
- 'text_processing' => TRUE,
- 'max_length' => 4096,
- ],
- ],
+ 'text_processing' => TRUE,
+ 'max_length' => 4096,
+ ]],
['list_string', 'optionwidgets_buttons'],
['list_string', 'optionwidgets_select'],
['boolean', 'optionwidgets_onoff'],
- ['text_long', 'text_textarea', ['text_processing' => TRUE]],
- ['string_long', 'text_textarea', ['text_processing' => FALSE]],
+ ['text_long', 'text_textarea', [
+ 'text_processing' => TRUE,
+ ]],
+ ['string_long', 'text_textarea', [
+ 'text_processing' => FALSE,
+ ]],
[NULL, 'undefined'],
];
}
only in patch2:
unchanged:
--- a/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
+++ b/core/modules/text/tests/src/Unit/Plugin/migrate/field/d6/TextFieldTest.php
@@ -122,33 +122,37 @@ public function testProcessBooleanTextExplicitValues() {
*/
public function getFieldTypeProvider() {
return [
- ['string_long', 'text_textfield', ['text_processing' => FALSE]],
+ ['string_long', 'text_textfield', [
+ 'text_processing' => FALSE,
+ ]],
['string', 'text_textfield', [
- 'text_processing' => FALSE,
- 'max_length' => 128,
- ],
- ],
+ 'text_processing' => FALSE,
+ 'max_length' => 128,
+ ]],
['string_long', 'text_textfield', [
- 'text_processing' => FALSE,
- 'max_length' => 4096,
- ],
- ],
- ['text_long', 'text_textfield', ['text_processing' => TRUE]],
+ 'text_processing' => FALSE,
+ 'max_length' => 4096,
+ ]],
+ ['text_long', 'text_textfield', [
+ 'text_processing' => TRUE,
+ ]],
['text', 'text_textfield', [
- 'text_processing' => TRUE,
- 'max_length' => 128,
- ],
- ],
+ 'text_processing' => TRUE,
+ 'max_length' => 128,
+ ]],
['text_long', 'text_textfield', [
- 'text_processing' => TRUE,
- 'max_length' => 4096,
- ],
- ],
+ 'text_processing' => TRUE,
+ 'max_length' => 4096,
+ ]],
['list_string', 'optionwidgets_buttons'],
['list_string', 'optionwidgets_select'],
['boolean', 'optionwidgets_onoff'],
- ['text_long', 'text_textarea', ['text_processing' => TRUE]],
- ['string_long', 'text_textarea', ['text_processing' => FALSE]],
+ ['text_long', 'text_textarea', [
+ 'text_processing' => TRUE,
+ ]],
+ ['string_long', 'text_textarea', [
+ 'text_processing' => FALSE,
+ ]],
[NULL, 'undefined'],
];
}
only in patch2:
unchanged:
--- a/core/modules/toolbar/toolbar.api.php
+++ b/core/modules/toolbar/toolbar.api.php
@@ -109,7 +109,7 @@ function hook_toolbar() {
'#heading' => t('Shopping cart actions'),
'shopping_cart' => [
'#theme' => 'item_list',
- '#items' => [/* An item list renderable array */ ],
+ '#items' => [ /* An item list renderable array */ ],
],
],
'#weight' => 150,
only in patch2:
unchanged:
--- a/core/modules/update/src/Form/UpdateManagerUpdate.php
+++ b/core/modules/update/src/Form/UpdateManagerUpdate.php
@@ -181,12 +181,10 @@ public function buildForm(array $form, FormStateInterface $form_state) {
}
// Use the project title for the tableselect checkboxes.
- $entry['title'] = [
- 'data' => [
- '#title' => $entry['title'],
- '#markup' => $entry['title'],
- ],
- ];
+ $entry['title'] = ['data' => [
+ '#title' => $entry['title'],
+ '#markup' => $entry['title'],
+ ]];
$entry['#attributes'] = ['class' => ['update-' . $type]];
// Drupal core needs to be upgraded manually.
only in patch2:
unchanged:
--- a/core/modules/user/migration_templates/d7_user.yml
+++ b/core/modules/user/migration_templates/d7_user.yml
@@ -55,3 +55,4 @@ migration_dependencies:
- user_picture_field_instance
- user_picture_entity_display
- user_picture_entity_form_display
+ - d7_field_instance
only in patch2:
unchanged:
--- a/core/modules/user/src/Entity/User.php
+++ b/core/modules/user/src/Entity/User.php
@@ -9,7 +9,6 @@
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Language\LanguageInterface;
use Drupal\user\RoleInterface;
-use Drupal\user\TimeZoneItem;
use Drupal\user\UserInterface;
/**
@@ -499,7 +498,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
->addPropertyConstraints('value', [
'AllowedValues' => ['callback' => __CLASS__ . '::getAllowedTimezones'],
]);
- $fields['timezone']->getItemDefinition()->setClass(TimeZoneItem::class);
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('User status'))
only in patch2:
unchanged:
--- a/core/modules/user/src/Form/UserPermissionsForm.php
+++ b/core/modules/user/src/Form/UserPermissionsForm.php
@@ -129,16 +129,14 @@ public function buildForm(array $form, FormStateInterface $form_state) {
foreach ($permissions_by_provider as $provider => $permissions) {
// Module name.
- $form['permissions'][$provider] = [
- [
- '#wrapper_attributes' => [
- 'colspan' => count($role_names) + 1,
- 'class' => ['module'],
- 'id' => 'module-' . $provider,
- ],
- '#markup' => $this->moduleHandler->getName($provider),
+ $form['permissions'][$provider] = [[
+ '#wrapper_attributes' => [
+ 'colspan' => count($role_names) + 1,
+ 'class' => ['module'],
+ 'id' => 'module-' . $provider,
],
- ];
+ '#markup' => $this->moduleHandler->getName($provider),
+ ]];
foreach ($permissions as $perm => $perm_item) {
// Fill in default values for the permission.
$perm_item += [
only in patch2:
unchanged:
--- a/core/modules/user/src/Plugin/Search/UserSearch.php
+++ b/core/modules/user/src/Plugin/Search/UserSearch.php
@@ -162,15 +162,13 @@ public function execute() {
* {@inheritdoc}
*/
public function getHelp() {
- $help = [
- 'list' => [
- '#theme' => 'item_list',
- '#items' => [
- $this->t('User search looks for user names and partial user names. Example: mar would match usernames mar, delmar, and maryjane.'),
- $this->t('You can use * as a wildcard within your keyword. Example: m*r would match user names mar, delmar, and elementary.'),
- ],
+ $help = ['list' => [
+ '#theme' => 'item_list',
+ '#items' => [
+ $this->t('User search looks for user names and partial user names. Example: mar would match usernames mar, delmar, and maryjane.'),
+ $this->t('You can use * as a wildcard within your keyword. Example: m*r would match user names mar, delmar, and elementary.'),
],
- ];
+ ]];
return $help;
}
only in patch2:
unchanged:
--- a/core/modules/user/src/Plugin/migrate/source/UserPictureInstance.php
+++ b/core/modules/user/src/Plugin/migrate/source/UserPictureInstance.php
@@ -29,8 +29,7 @@ public function initializeIterator() {
'file_directory' => $this->variableGet('user_picture_path', 'pictures'),
'max_filesize' => $this->variableGet('user_picture_file_size', '30') . 'KB',
'max_resolution' => $this->variableGet('user_picture_dimensions', '85x85'),
- ],
- ]);
+ ]]);
}
/**
only in patch2:
unchanged:
--- a/core/modules/user/src/Tests/UserPasswordResetTest.php
+++ b/core/modules/user/src/Tests/UserPasswordResetTest.php
@@ -130,7 +130,7 @@ public function testUserPasswordReset() {
// Verify that the password reset session has been destroyed.
$this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertText(t("Your current password is missing or incorrect; it's required to change the Password."), 'Password needed to make profile changes.');
+ $this->assertText(t('Your current password is missing or incorrect; it\'s required to change the Password.'), 'Password needed to make profile changes.');
// Log out, and try to log in again using the same one-time link.
$this->drupalLogout();
@@ -144,7 +144,7 @@ public function testUserPasswordReset() {
$before = count($this->drupalGetMails(['id' => 'user_password_reset']));
$edit = ['name' => $this->account->getEmail()];
$this->drupalPostForm(NULL, $edit, t('Submit'));
- $this->assertTrue(count($this->drupalGetMails(['id' => 'user_password_reset'])) === $before + 1, 'Email sent when requesting password reset using email address.');
+ $this->assertTrue( count($this->drupalGetMails(['id' => 'user_password_reset'])) === $before + 1, 'Email sent when requesting password reset using email address.');
// Visit the user edit page without pass-reset-token and make sure it does
// not cause an error.
only in patch2:
unchanged:
--- a/core/modules/user/src/TimeZoneItem.php
+++ /dev/null
@@ -1,24 +0,0 @@
-installEntitySchema('user');
- }
-
- /**
* Tests some of the methods.
*
* @see \Drupal\user\Entity\User::getRoles()
@@ -73,22 +65,4 @@ public function testUserMethods() {
$this->assertEqual([RoleInterface::AUTHENTICATED_ID, 'test_role_two'], $user->getRoles());
}
- /**
- * Tests that all user fields validate properly.
- *
- * @see \Drupal\Core\Field\FieldItemListInterface::generateSampleItems
- * @see \Drupal\Core\Field\FieldItemInterface::generateSampleValue()
- * @see \Drupal\Core\Entity\FieldableEntityInterface::validate()
- */
- public function testUserValidation() {
- $user = User::create([]);
- foreach ($user as $field_name => $field) {
- if (!in_array($field_name, ['uid'])) {
- $user->$field_name->generateSampleItems();
- }
- }
- $violations = $user->validate();
- $this->assertFalse((bool) $violations->count());
- }
-
}
only in patch2:
unchanged:
--- a/core/modules/user/tests/src/Kernel/UserValidationTest.php
+++ b/core/modules/user/tests/src/Kernel/UserValidationTest.php
@@ -40,7 +40,7 @@ protected function setUp() {
* Tests user name validation.
*/
public function testUsernames() {
- $test_cases = [// '' => array('', 'assert'),
+ $test_cases = [ // '' => array('', 'assert'),
'foo' => ['Valid username', 'assertNull'],
'FOO' => ['Valid username', 'assertNull'],
'Foo O\'Bar' => ['Valid username', 'assertNull'],
only in patch2:
unchanged:
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -78,7 +78,7 @@ function user_help($route_name, RouteMatchInterface $route_match) {
$output .= '
' . t('Setting permissions') . '
';
$output .= '
' . t('After creating roles, you can set permissions for each role on the Permissions page. Granting a permission allows users who have been assigned a particular role to perform an action on the site, such as viewing content, editing or creating a particular type of content, administering settings for a particular module, or using a particular function of the site (such as search).', [':permissions_user' => \Drupal::url('user.admin_permissions')]) . '
';
$output .= '
' . t('Managing account settings') . '
';
- $output .= '
' . t('The Account settings page allows you to manage settings for the displayed name of the Anonymous user role, personal contact forms, user registration settings, and account cancellation settings. On this page you can also manage settings for account personalization, and adapt the text for the email messages that users receive when they register or request a password recovery. You may also set which role is automatically assigned new permissions whenever a module is enabled (the Administrator role).', [':accounts' => \Drupal::url('entity.user.admin_form')]) . '
';
+ $output .= '
' . t('The Account settings page allows you to manage settings for the displayed name of the Anonymous user role, personal contact forms, user registration settings, and account cancellation settings. On this page you can also manage settings for account personalization, and adapt the text for the email messages that users receive when they register or request a password recovery. You may also set which role is automatically assigned new permissions whenever a module is enabled (the Administrator role).', [':accounts' => \Drupal::url('entity.user.admin_form')]) . '
';
$output .= '
' . t('Managing user account fields') . '
';
$output .= '
' . t('Because User accounts are an entity type, you can extend them by adding fields through the Manage fields tab on the Account settings page. By adding fields for e.g., a picture, a biography, or address, you can a create a custom profile for the users of the website. For background information on entities and fields, see the Field module help page.', [':field_help' => (\Drupal::moduleHandler()->moduleExists('field')) ? \Drupal::url('help.page', ['name' => 'field']) : '#', ':accounts' => \Drupal::url('entity.user.admin_form')]) . '