diff --git a/composer.json b/composer.json index fd12d9579cd63d3b325a6568d06fc475f8017718..69998b3eb7310a7cac67c474209563fe04dbec61 100644 --- a/composer.json +++ b/composer.json @@ -116,7 +116,7 @@ "drupal/entity": "1.2", "drupal/entity_browser": "2.8", "drupal/entity_clone": "1.0.0-beta5", - "drupal/entity_embed": "1.2", + "drupal/entity_embed": "1.3", "drupal/entity_reference_revisions": "1.9", "drupal/exif_orientation": "^1.1", "drupal/externalauth": "1.4", @@ -288,6 +288,9 @@ "drupal/entity_clone": { "3060223": "https://www.drupal.org/files/issues/2019-10-17/%20entity_clone-corrupted-paragraph-cloning-3060223-5.patch" }, + "drupal/entity_embed": { + "3077225": "https://www.drupal.org/files/issues/2019-12-11/3077225-10.reduce-invalid-config-logs.patch" + }, "drupal/honeypot": { "2811189": "https://www.drupal.org/files/issues/2022-05-25/honeypot-field_weight-2811189-27_0.patch" }, diff --git a/composer.lock b/composer.lock index f4380ee428e4f9f4fec9ca4e74461ee3f353cc9e..47919d38c6682f8202b401751c8ebf6404cc1514 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "96b1beba974d35b96510b637bd80c4a7", + "content-hash": "e19bbc8cca8ae09736e3d9b709548c69", "packages": [ { "name": "alchemy/zippy", @@ -4063,21 +4063,21 @@ }, { "name": "drupal/entity_embed", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/entity_embed.git", - "reference": "8.x-1.2" + "reference": "8.x-1.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/entity_embed-8.x-1.2.zip", - "reference": "8.x-1.2", - "shasum": "e1d4c9d6931984836c1ea550c32ae40f42367525" + "url": "https://ftp.drupal.org/files/projects/entity_embed-8.x-1.3.zip", + "reference": "8.x-1.3", + "shasum": "37781222e0b31a0319f0b2e67ef345f2033435e7" }, "require": { - "drupal/core": "^8.8 || ^9", - "drupal/embed": "^1.3" + "drupal/core": "^9.3", + "drupal/embed": "^1.5" }, "require-dev": { "drupal/entity_browser": "^2.2" @@ -4085,8 +4085,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.2", - "datestamp": "1631726164", + "version": "8.x-1.3", + "datestamp": "1666275539", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -4095,7 +4095,7 @@ }, "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ { @@ -4134,9 +4134,7 @@ "description": "Allows any entity to be embedded within a text area using a WYSIWYG editor.", "homepage": "https://www.drupal.org/project/entity_embed", "support": { - "source": "https://git.drupalcode.org/project/entity_embed", - "issues": "https://www.drupal.org/project/issues/entity_embed", - "irc": "irc://irc.freenode.org/drupal-media" + "source": "https://git.drupalcode.org/project/entity_embed" } }, { @@ -12866,16 +12864,16 @@ }, { "name": "symfony/console", - "version": "v4.4.45", + "version": "v4.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "28b77970939500fb04180166a1f716e75a871ef8" + "reference": "4f40012db8d55c956406890b5720f686fee7f7b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/28b77970939500fb04180166a1f716e75a871ef8", - "reference": "28b77970939500fb04180166a1f716e75a871ef8", + "url": "https://api.github.com/repos/symfony/console/zipball/4f40012db8d55c956406890b5720f686fee7f7b7", + "reference": "4f40012db8d55c956406890b5720f686fee7f7b7", "shasum": "" }, "require": { @@ -12936,7 +12934,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.45" + "source": "https://github.com/symfony/console/tree/v4.4.47" }, "funding": [ { @@ -12952,7 +12950,7 @@ "type": "tidelift" } ], - "time": "2022-08-17T14:50:19+00:00" + "time": "2022-10-04T05:58:30+00:00" }, { "name": "symfony/css-selector", @@ -13898,16 +13896,16 @@ }, { "name": "symfony/http-foundation", - "version": "v4.4.46", + "version": "v4.4.47", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "7acdc97f28a48b96def93af1efd77cfc5e8776dd" + "reference": "7eea76ae186c68466e7676e62812ce2769f96811" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7acdc97f28a48b96def93af1efd77cfc5e8776dd", - "reference": "7acdc97f28a48b96def93af1efd77cfc5e8776dd", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7eea76ae186c68466e7676e62812ce2769f96811", + "reference": "7eea76ae186c68466e7676e62812ce2769f96811", "shasum": "" }, "require": { @@ -13946,7 +13944,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v4.4.46" + "source": "https://github.com/symfony/http-foundation/tree/v4.4.47" }, "funding": [ { @@ -13962,20 +13960,20 @@ "type": "tidelift" } ], - "time": "2022-09-13T06:14:47+00:00" + "time": "2022-10-01T21:39:02+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.46", + "version": "v4.4.47", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "fb72bc54f300151fadef84fce79764138b1ef943" + "reference": "91cf5dbc9ea4d902470e596246a736179acfb79d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fb72bc54f300151fadef84fce79764138b1ef943", - "reference": "fb72bc54f300151fadef84fce79764138b1ef943", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/91cf5dbc9ea4d902470e596246a736179acfb79d", + "reference": "91cf5dbc9ea4d902470e596246a736179acfb79d", "shasum": "" }, "require": { @@ -14050,7 +14048,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v4.4.46" + "source": "https://github.com/symfony/http-kernel/tree/v4.4.47" }, "funding": [ { @@ -14066,7 +14064,7 @@ "type": "tidelift" } ], - "time": "2022-09-30T07:27:59+00:00" + "time": "2022-10-12T07:05:45+00:00" }, { "name": "symfony/mime", @@ -15128,16 +15126,16 @@ }, { "name": "symfony/serializer", - "version": "v4.4.45", + "version": "v4.4.47", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "d19621a350491f76e2faed2afb982e0706f63252" + "reference": "6e01d63c55657930a6de03d6e36aae50af98888d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/d19621a350491f76e2faed2afb982e0706f63252", - "reference": "d19621a350491f76e2faed2afb982e0706f63252", + "url": "https://api.github.com/repos/symfony/serializer/zipball/6e01d63c55657930a6de03d6e36aae50af98888d", + "reference": "6e01d63c55657930a6de03d6e36aae50af98888d", "shasum": "" }, "require": { @@ -15202,7 +15200,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v4.4.45" + "source": "https://github.com/symfony/serializer/tree/v4.4.47" }, "funding": [ { @@ -15218,7 +15216,7 @@ "type": "tidelift" } ], - "time": "2022-08-17T14:28:21+00:00" + "time": "2022-09-19T08:38:33+00:00" }, { "name": "symfony/service-contracts", @@ -15305,16 +15303,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.45", + "version": "v4.4.47", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4e6b4c0dbeb04d6f004ed7f43eb0905ce8396def" + "reference": "45036b1d53accc48fe9bab71ccd86d57eba0dd94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/4e6b4c0dbeb04d6f004ed7f43eb0905ce8396def", - "reference": "4e6b4c0dbeb04d6f004ed7f43eb0905ce8396def", + "url": "https://api.github.com/repos/symfony/translation/zipball/45036b1d53accc48fe9bab71ccd86d57eba0dd94", + "reference": "45036b1d53accc48fe9bab71ccd86d57eba0dd94", "shasum": "" }, "require": { @@ -15374,7 +15372,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.45" + "source": "https://github.com/symfony/translation/tree/v4.4.47" }, "funding": [ { @@ -15390,7 +15388,7 @@ "type": "tidelift" } ], - "time": "2022-08-02T12:44:49+00:00" + "time": "2022-10-03T15:15:11+00:00" }, { "name": "symfony/translation-contracts", @@ -15472,16 +15470,16 @@ }, { "name": "symfony/validator", - "version": "v4.4.46", + "version": "v4.4.47", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "51d06a00a7a8e9c45b91735932040b9f1df2c994" + "reference": "37456082bb034cb5f2d8602471a0de6c448535b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/51d06a00a7a8e9c45b91735932040b9f1df2c994", - "reference": "51d06a00a7a8e9c45b91735932040b9f1df2c994", + "url": "https://api.github.com/repos/symfony/validator/zipball/37456082bb034cb5f2d8602471a0de6c448535b8", + "reference": "37456082bb034cb5f2d8602471a0de6c448535b8", "shasum": "" }, "require": { @@ -15558,7 +15556,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v4.4.46" + "source": "https://github.com/symfony/validator/tree/v4.4.47" }, "funding": [ { @@ -15574,20 +15572,20 @@ "type": "tidelift" } ], - "time": "2022-09-15T12:26:05+00:00" + "time": "2022-10-01T17:13:09+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.13", + "version": "v5.4.14", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2bf2ccab581bec363191672f0df40e0c85569e1c" + "reference": "6894d06145fefebd9a4c7272baa026a1c394a430" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2bf2ccab581bec363191672f0df40e0c85569e1c", - "reference": "2bf2ccab581bec363191672f0df40e0c85569e1c", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6894d06145fefebd9a4c7272baa026a1c394a430", + "reference": "6894d06145fefebd9a4c7272baa026a1c394a430", "shasum": "" }, "require": { @@ -15647,7 +15645,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.13" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.14" }, "funding": [ { @@ -15663,7 +15661,7 @@ "type": "tidelift" } ], - "time": "2022-09-06T13:23:31+00:00" + "time": "2022-10-07T08:01:20+00:00" }, { "name": "symfony/var-exporter", diff --git a/vendor/autoload.php b/vendor/autoload.php index 11c4986bd5b582daf5cd57a95b2031afaec294c8..21b9f174aedfe5928f05fac605da83b90cf5e48b 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -3,8 +3,21 @@ // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { - echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; - exit(1); + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); } require_once __DIR__ . '/composer/autoload_real.php'; diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 69156ac9f9202183ddf918685b8e85bada8cb213..7f3992dc8e7abd507e892abff92f8a1a01b1c85f 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2284,8 +2284,6 @@ 'Drupal\\Core\\Language\\LanguageManager' => $baseDir . '/web/core/lib/Drupal/Core/Language/LanguageManager.php', 'Drupal\\Core\\Language\\LanguageManagerInterface' => $baseDir . '/web/core/lib/Drupal/Core/Language/LanguageManagerInterface.php', 'Drupal\\Core\\Layout\\Annotation\\Layout' => $baseDir . '/web/core/lib/Drupal/Core/Layout/Annotation/Layout.php', - 'Drupal\\Core\\Layout\\Icon\\IconBuilderInterface' => $baseDir . '/web/core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php', - 'Drupal\\Core\\Layout\\Icon\\SvgIconBuilder' => $baseDir . '/web/core/lib/Drupal/Core/Layout/Icon/SvgIconBuilder.php', 'Drupal\\Core\\Layout\\LayoutDefault' => $baseDir . '/web/core/lib/Drupal/Core/Layout/LayoutDefault.php', 'Drupal\\Core\\Layout\\LayoutDefinition' => $baseDir . '/web/core/lib/Drupal/Core/Layout/LayoutDefinition.php', 'Drupal\\Core\\Layout\\LayoutInterface' => $baseDir . '/web/core/lib/Drupal/Core/Layout/LayoutInterface.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 8144af166e94a67462a3be4fe3e31748530ca50f..dc27cc7768d43d611825e74239d891ad839dd737 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -3105,8 +3105,6 @@ class ComposerStaticInit5c689ffcd54b9e495ed983fdce09b530 'Drupal\\Core\\Language\\LanguageManager' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Language/LanguageManager.php', 'Drupal\\Core\\Language\\LanguageManagerInterface' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Language/LanguageManagerInterface.php', 'Drupal\\Core\\Layout\\Annotation\\Layout' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/Annotation/Layout.php', - 'Drupal\\Core\\Layout\\Icon\\IconBuilderInterface' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/Icon/IconBuilderInterface.php', - 'Drupal\\Core\\Layout\\Icon\\SvgIconBuilder' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/Icon/SvgIconBuilder.php', 'Drupal\\Core\\Layout\\LayoutDefault' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/LayoutDefault.php', 'Drupal\\Core\\Layout\\LayoutDefinition' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/LayoutDefinition.php', 'Drupal\\Core\\Layout\\LayoutInterface' => __DIR__ . '/../..' . '/web/core/lib/Drupal/Core/Layout/LayoutInterface.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ca4241f3178c41a96c1497da371a22ccd8e8498f..ce7df05764c5fc5d3990f662d83e3f2025b74267 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -4177,22 +4177,22 @@ }, { "name": "drupal/entity_embed", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "version": "1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/entity_embed.git", - "reference": "8.x-1.2" + "reference": "8.x-1.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/entity_embed-8.x-1.2.zip", - "reference": "8.x-1.2", - "shasum": "e1d4c9d6931984836c1ea550c32ae40f42367525" + "url": "https://ftp.drupal.org/files/projects/entity_embed-8.x-1.3.zip", + "reference": "8.x-1.3", + "shasum": "37781222e0b31a0319f0b2e67ef345f2033435e7" }, "require": { - "drupal/core": "^8.8 || ^9", - "drupal/embed": "^1.3" + "drupal/core": "^9.3", + "drupal/embed": "^1.5" }, "require-dev": { "drupal/entity_browser": "^2.2" @@ -4200,20 +4200,27 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.2", - "datestamp": "1631726164", + "version": "8.x-1.3", + "datestamp": "1666275539", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" } + }, + "patches_applied": { + "3077225": "https://www.drupal.org/files/issues/2019-12-11/3077225-10.reduce-invalid-config-logs.patch" } }, "installation-source": "dist", "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0+" + "GPL-2.0-or-later" ], "authors": [ + { + "name": "cs_shadow", + "homepage": "https://www.drupal.org/user/2828287" + }, { "name": "Dave Reid", "homepage": "https://www.drupal.org/user/53892" @@ -4226,14 +4233,6 @@ "name": "Drupal Media Team", "homepage": "https://www.drupal.org/user/3260690" }, - { - "name": "Wim Leers", - "homepage": "https://www.drupal.org/user/99777" - }, - { - "name": "cs_shadow", - "homepage": "https://www.drupal.org/user/2828287" - }, { "name": "oknate", "homepage": "https://www.drupal.org/user/471638" @@ -4245,14 +4244,16 @@ { "name": "slashrsm", "homepage": "https://www.drupal.org/user/744628" + }, + { + "name": "Wim Leers", + "homepage": "https://www.drupal.org/user/99777" } ], "description": "Allows any entity to be embedded within a text area using a WYSIWYG editor.", "homepage": "https://www.drupal.org/project/entity_embed", "support": { - "source": "https://git.drupalcode.org/project/entity_embed", - "issues": "https://www.drupal.org/project/issues/entity_embed", - "irc": "irc://irc.freenode.org/drupal-media" + "source": "https://git.drupalcode.org/project/entity_embed" }, "install-path": "../../web/modules/entity_embed" }, @@ -13345,17 +13346,17 @@ }, { "name": "symfony/console", - "version": "v4.4.45", - "version_normalized": "4.4.45.0", + "version": "v4.4.47", + "version_normalized": "4.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "28b77970939500fb04180166a1f716e75a871ef8" + "reference": "4f40012db8d55c956406890b5720f686fee7f7b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/28b77970939500fb04180166a1f716e75a871ef8", - "reference": "28b77970939500fb04180166a1f716e75a871ef8", + "url": "https://api.github.com/repos/symfony/console/zipball/4f40012db8d55c956406890b5720f686fee7f7b7", + "reference": "4f40012db8d55c956406890b5720f686fee7f7b7", "shasum": "" }, "require": { @@ -13390,7 +13391,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2022-08-17T14:50:19+00:00", + "time": "2022-10-04T05:58:30+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -13418,7 +13419,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.45" + "source": "https://github.com/symfony/console/tree/v4.4.47" }, "funding": [ { @@ -14416,17 +14417,17 @@ }, { "name": "symfony/http-foundation", - "version": "v4.4.46", - "version_normalized": "4.4.46.0", + "version": "v4.4.47", + "version_normalized": "4.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "7acdc97f28a48b96def93af1efd77cfc5e8776dd" + "reference": "7eea76ae186c68466e7676e62812ce2769f96811" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7acdc97f28a48b96def93af1efd77cfc5e8776dd", - "reference": "7acdc97f28a48b96def93af1efd77cfc5e8776dd", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7eea76ae186c68466e7676e62812ce2769f96811", + "reference": "7eea76ae186c68466e7676e62812ce2769f96811", "shasum": "" }, "require": { @@ -14439,7 +14440,7 @@ "predis/predis": "~1.0", "symfony/expression-language": "^3.4|^4.0|^5.0" }, - "time": "2022-09-13T06:14:47+00:00", + "time": "2022-10-01T21:39:02+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -14467,7 +14468,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v4.4.46" + "source": "https://github.com/symfony/http-foundation/tree/v4.4.47" }, "funding": [ { @@ -14487,17 +14488,17 @@ }, { "name": "symfony/http-kernel", - "version": "v4.4.46", - "version_normalized": "4.4.46.0", + "version": "v4.4.47", + "version_normalized": "4.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "fb72bc54f300151fadef84fce79764138b1ef943" + "reference": "91cf5dbc9ea4d902470e596246a736179acfb79d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fb72bc54f300151fadef84fce79764138b1ef943", - "reference": "fb72bc54f300151fadef84fce79764138b1ef943", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/91cf5dbc9ea4d902470e596246a736179acfb79d", + "reference": "91cf5dbc9ea4d902470e596246a736179acfb79d", "shasum": "" }, "require": { @@ -14546,7 +14547,7 @@ "symfony/console": "", "symfony/dependency-injection": "" }, - "time": "2022-09-30T07:27:59+00:00", + "time": "2022-10-12T07:05:45+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -14574,7 +14575,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v4.4.46" + "source": "https://github.com/symfony/http-kernel/tree/v4.4.47" }, "funding": [ { @@ -15691,17 +15692,17 @@ }, { "name": "symfony/serializer", - "version": "v4.4.45", - "version_normalized": "4.4.45.0", + "version": "v4.4.47", + "version_normalized": "4.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "d19621a350491f76e2faed2afb982e0706f63252" + "reference": "6e01d63c55657930a6de03d6e36aae50af98888d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/d19621a350491f76e2faed2afb982e0706f63252", - "reference": "d19621a350491f76e2faed2afb982e0706f63252", + "url": "https://api.github.com/repos/symfony/serializer/zipball/6e01d63c55657930a6de03d6e36aae50af98888d", + "reference": "6e01d63c55657930a6de03d6e36aae50af98888d", "shasum": "" }, "require": { @@ -15740,7 +15741,7 @@ "symfony/property-info": "To deserialize relations.", "symfony/yaml": "For using the default YAML mapping loader." }, - "time": "2022-08-17T14:28:21+00:00", + "time": "2022-09-19T08:38:33+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -15768,7 +15769,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v4.4.45" + "source": "https://github.com/symfony/serializer/tree/v4.4.47" }, "funding": [ { @@ -15874,17 +15875,17 @@ }, { "name": "symfony/translation", - "version": "v4.4.45", - "version_normalized": "4.4.45.0", + "version": "v4.4.47", + "version_normalized": "4.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4e6b4c0dbeb04d6f004ed7f43eb0905ce8396def" + "reference": "45036b1d53accc48fe9bab71ccd86d57eba0dd94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/4e6b4c0dbeb04d6f004ed7f43eb0905ce8396def", - "reference": "4e6b4c0dbeb04d6f004ed7f43eb0905ce8396def", + "url": "https://api.github.com/repos/symfony/translation/zipball/45036b1d53accc48fe9bab71ccd86d57eba0dd94", + "reference": "45036b1d53accc48fe9bab71ccd86d57eba0dd94", "shasum": "" }, "require": { @@ -15918,7 +15919,7 @@ "symfony/config": "", "symfony/yaml": "" }, - "time": "2022-08-02T12:44:49+00:00", + "time": "2022-10-03T15:15:11+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -15946,7 +15947,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.45" + "source": "https://github.com/symfony/translation/tree/v4.4.47" }, "funding": [ { @@ -16047,17 +16048,17 @@ }, { "name": "symfony/validator", - "version": "v4.4.46", - "version_normalized": "4.4.46.0", + "version": "v4.4.47", + "version_normalized": "4.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "51d06a00a7a8e9c45b91735932040b9f1df2c994" + "reference": "37456082bb034cb5f2d8602471a0de6c448535b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/51d06a00a7a8e9c45b91735932040b9f1df2c994", - "reference": "51d06a00a7a8e9c45b91735932040b9f1df2c994", + "url": "https://api.github.com/repos/symfony/validator/zipball/37456082bb034cb5f2d8602471a0de6c448535b8", + "reference": "37456082bb034cb5f2d8602471a0de6c448535b8", "shasum": "" }, "require": { @@ -16108,7 +16109,7 @@ "symfony/translation": "For translating validation errors.", "symfony/yaml": "" }, - "time": "2022-09-15T12:26:05+00:00", + "time": "2022-10-01T17:13:09+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -16136,7 +16137,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v4.4.46" + "source": "https://github.com/symfony/validator/tree/v4.4.47" }, "funding": [ { @@ -16156,17 +16157,17 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.13", - "version_normalized": "5.4.13.0", + "version": "v5.4.14", + "version_normalized": "5.4.14.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2bf2ccab581bec363191672f0df40e0c85569e1c" + "reference": "6894d06145fefebd9a4c7272baa026a1c394a430" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2bf2ccab581bec363191672f0df40e0c85569e1c", - "reference": "2bf2ccab581bec363191672f0df40e0c85569e1c", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6894d06145fefebd9a4c7272baa026a1c394a430", + "reference": "6894d06145fefebd9a4c7272baa026a1c394a430", "shasum": "" }, "require": { @@ -16190,7 +16191,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2022-09-06T13:23:31+00:00", + "time": "2022-10-07T08:01:20+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -16228,7 +16229,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.13" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.14" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index d8401b48eca79f83068c5f6179d4ae829085074c..4e7710b1a9ae842388d95044c4c0e05a14783d3f 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'osu-asc-webservices/d8-upstream', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '307002cfb9be8e48750eba3ef62cc6d168543882', + 'reference' => 'a951dabf39faebf5051f29113cc4cde06dffbcca', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -758,9 +758,9 @@ 'dev_requirement' => false, ), 'drupal/entity_embed' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'reference' => '8.x-1.2', + 'pretty_version' => '1.3.0', + 'version' => '1.3.0.0', + 'reference' => '8.x-1.3', 'type' => 'drupal-module', 'install_path' => __DIR__ . '/../../web/modules/entity_embed', 'aliases' => array(), @@ -1594,7 +1594,7 @@ 'osu-asc-webservices/d8-upstream' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '307002cfb9be8e48750eba3ef62cc6d168543882', + 'reference' => 'a951dabf39faebf5051f29113cc4cde06dffbcca', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -2154,9 +2154,9 @@ 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v4.4.45', - 'version' => '4.4.45.0', - 'reference' => '28b77970939500fb04180166a1f716e75a871ef8', + 'pretty_version' => 'v4.4.47', + 'version' => '4.4.47.0', + 'reference' => '4f40012db8d55c956406890b5720f686fee7f7b7', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), @@ -2277,18 +2277,18 @@ 'dev_requirement' => false, ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v4.4.46', - 'version' => '4.4.46.0', - 'reference' => '7acdc97f28a48b96def93af1efd77cfc5e8776dd', + 'pretty_version' => 'v4.4.47', + 'version' => '4.4.47.0', + 'reference' => '7eea76ae186c68466e7676e62812ce2769f96811', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/http-kernel' => array( - 'pretty_version' => 'v4.4.46', - 'version' => '4.4.46.0', - 'reference' => 'fb72bc54f300151fadef84fce79764138b1ef943', + 'pretty_version' => 'v4.4.47', + 'version' => '4.4.47.0', + 'reference' => '91cf5dbc9ea4d902470e596246a736179acfb79d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-kernel', 'aliases' => array(), @@ -2412,9 +2412,9 @@ 'dev_requirement' => false, ), 'symfony/serializer' => array( - 'pretty_version' => 'v4.4.45', - 'version' => '4.4.45.0', - 'reference' => 'd19621a350491f76e2faed2afb982e0706f63252', + 'pretty_version' => 'v4.4.47', + 'version' => '4.4.47.0', + 'reference' => '6e01d63c55657930a6de03d6e36aae50af98888d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/serializer', 'aliases' => array(), @@ -2436,9 +2436,9 @@ ), ), 'symfony/translation' => array( - 'pretty_version' => 'v4.4.45', - 'version' => '4.4.45.0', - 'reference' => '4e6b4c0dbeb04d6f004ed7f43eb0905ce8396def', + 'pretty_version' => 'v4.4.47', + 'version' => '4.4.47.0', + 'reference' => '45036b1d53accc48fe9bab71ccd86d57eba0dd94', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), @@ -2460,18 +2460,18 @@ ), ), 'symfony/validator' => array( - 'pretty_version' => 'v4.4.46', - 'version' => '4.4.46.0', - 'reference' => '51d06a00a7a8e9c45b91735932040b9f1df2c994', + 'pretty_version' => 'v4.4.47', + 'version' => '4.4.47.0', + 'reference' => '37456082bb034cb5f2d8602471a0de6c448535b8', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/validator', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v5.4.13', - 'version' => '5.4.13.0', - 'reference' => '2bf2ccab581bec363191672f0df40e0c85569e1c', + 'pretty_version' => 'v5.4.14', + 'version' => '5.4.14.0', + 'reference' => '6894d06145fefebd9a4c7272baa026a1c394a430', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php index 0521aaf7d2933bf9108e2a58d0f1ba10282fd287..18d85b94073e0e9995703e94d83a2ddcae232c76 100644 --- a/vendor/symfony/console/Helper/Helper.php +++ b/vendor/symfony/console/Helper/Helper.php @@ -135,6 +135,8 @@ public static function removeDecoration(OutputFormatterInterface $formatter, $st $string = $formatter->format($string); // remove already formatted characters $string = preg_replace("/\033\[[^m]*m/", '', $string); + // remove terminal hyperlinks + $string = preg_replace('/\\033]8;[^;]*;[^\\033]*\\033\\\\/', '', $string); $formatter->setDecorated($isDecorated); return $string; diff --git a/vendor/symfony/http-foundation/BinaryFileResponse.php b/vendor/symfony/http-foundation/BinaryFileResponse.php index 2cd105c3bb0f380bfe9d9a140edddf29c2750fc7..1842256a3f01cd5fd93b5479778b6bf839a1a8bd 100644 --- a/vendor/symfony/http-foundation/BinaryFileResponse.php +++ b/vendor/symfony/http-foundation/BinaryFileResponse.php @@ -201,9 +201,9 @@ public function setContentDisposition($disposition, $filename = '', $filenameFal */ public function prepare(Request $request) { - parent::prepare($request); - if ($this->isInformational() || $this->isEmpty()) { + parent::prepare($request); + $this->maxlen = 0; return $this; @@ -213,6 +213,8 @@ public function prepare(Request $request) $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream'); } + parent::prepare($request); + $this->offset = 0; $this->maxlen = -1; diff --git a/vendor/symfony/http-kernel/Kernel.php b/vendor/symfony/http-kernel/Kernel.php index c6476b615d29aaf663bcab530388c2b6765d8b93..f944b3d9e6ac6148efce53108d5e8c05df7160b7 100644 --- a/vendor/symfony/http-kernel/Kernel.php +++ b/vendor/symfony/http-kernel/Kernel.php @@ -76,11 +76,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - public const VERSION = '4.4.46'; - public const VERSION_ID = 40446; + public const VERSION = '4.4.47'; + public const VERSION_ID = 40447; public const MAJOR_VERSION = 4; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 46; + public const RELEASE_VERSION = 47; public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2022'; diff --git a/vendor/symfony/serializer/Mapping/ClassDiscriminatorMapping.php b/vendor/symfony/serializer/Mapping/ClassDiscriminatorMapping.php index 0c314c7ba455d2ce9d845ccfba5d87e8c8e4deaa..ffaa8eab9a8ecb7cdbf9837e442bb87eceb52f98 100644 --- a/vendor/symfony/serializer/Mapping/ClassDiscriminatorMapping.php +++ b/vendor/symfony/serializer/Mapping/ClassDiscriminatorMapping.php @@ -53,7 +53,7 @@ public function getClassForType(string $type): ?string public function getMappedObjectType($object): ?string { foreach ($this->typesMapping as $type => $typeClass) { - if (is_a($object, $typeClass)) { + if (is_a($object, $typeClass, true)) { return $type; } } diff --git a/vendor/symfony/translation/Resources/bin/translation-status.php b/vendor/symfony/translation/Resources/bin/translation-status.php index fac8acbadca32e20e35b029ef59649a5b2e788ac..53e642c00dca7ebca0b5ffbd3f474695c3fd3e24 100644 --- a/vendor/symfony/translation/Resources/bin/translation-status.php +++ b/vendor/symfony/translation/Resources/bin/translation-status.php @@ -9,6 +9,10 @@ * file that was distributed with this source code. */ +if ('cli' !== \PHP_SAPI) { + throw new Exception('This script must be run from the command line.'); +} + $usageInstructions = <<<END Usage instructions diff --git a/vendor/symfony/validator/Resources/translations/validators.nn.xlf b/vendor/symfony/validator/Resources/translations/validators.nn.xlf index 8963ba2d8c2c4674fd7315b5fd15a876a2924df8..fa472b5c194c2382a3882c8a75cc6fbe6d00fea8 100644 --- a/vendor/symfony/validator/Resources/translations/validators.nn.xlf +++ b/vendor/symfony/validator/Resources/translations/validators.nn.xlf @@ -386,6 +386,22 @@ <source>This value is not a valid International Securities Identification Number (ISIN).</source> <target>Verdien er ikkje eit gyldig International Securities Identification Number (ISIN).</target> </trans-unit> + <trans-unit id="100"> + <source>This value should be a valid expression.</source> + <target>Denne verdien skal være et gyldig uttrykk.</target> + </trans-unit> + <trans-unit id="101"> + <source>This value is not a valid CSS color.</source> + <target>Denne verdien er ikke en gyldig CSS-farge.</target> + </trans-unit> + <trans-unit id="102"> + <source>This value is not a valid CIDR notation.</source> + <target>Denne verdien er ikke en gyldig CIDR-notasjon.</target> + </trans-unit> + <trans-unit id="103"> + <source>The value of the netmask should be between {{ min }} and {{ max }}.</source> + <target>Verdien av nettmasken skal være mellom {{ min }} og {{ max }}.</target> + </trans-unit> </body> </file> </xliff> diff --git a/vendor/symfony/var-dumper/Resources/bin/var-dump-server b/vendor/symfony/var-dumper/Resources/bin/var-dump-server index 98c813a0639b5797bfa60d9c780860de655fcdc6..f398fcef72d3957f0d4789c39a5b6852e052007e 100755 --- a/vendor/symfony/var-dumper/Resources/bin/var-dump-server +++ b/vendor/symfony/var-dumper/Resources/bin/var-dump-server @@ -10,6 +10,10 @@ * file that was distributed with this source code. */ +if ('cli' !== PHP_SAPI) { + throw new Exception('This script must be run from the command line.'); +} + /** * Starts a dump server to collect and output dumps on a single place with multiple formats support. * diff --git a/web/modules/entity_embed/PATCHES.txt b/web/modules/entity_embed/PATCHES.txt new file mode 100644 index 0000000000000000000000000000000000000000..67cb811edc66f3520ab5c6473885525af9c6cb58 --- /dev/null +++ b/web/modules/entity_embed/PATCHES.txt @@ -0,0 +1,7 @@ +This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches) +Patches applied to this directory: + +3077225 +Source: https://www.drupal.org/files/issues/2019-12-11/3077225-10.reduce-invalid-config-logs.patch + + diff --git a/web/modules/entity_embed/composer.json b/web/modules/entity_embed/composer.json index 5fd24c40b6c167bfd93b9615a8763c88571f077c..5b2daed9cf6cc99deb649b69d6fc91a95528130c 100644 --- a/web/modules/entity_embed/composer.json +++ b/web/modules/entity_embed/composer.json @@ -1,18 +1,12 @@ { - "name": "drupal/entity_embed", - "description": "Allows any entity to be embedded within a text area using a WYSIWYG editor.", - "type": "drupal-module", - "homepage": "https://www.drupal.org/project/entity_embed", - "support": { - "issues": "https://www.drupal.org/project/issues/entity_embed", - "irc": "irc://irc.freenode.org/drupal-media" - }, - "license": "GPL-2.0+", - "require": { - "drupal/core": "^8.8 || ^9", - "drupal/embed": "^1.3" - }, - "require-dev": { - "drupal/entity_browser": "^2.2" - } + "name": "drupal/entity_embed", + "description": "Allows any entity to be embedded within a text area using a WYSIWYG editor.", + "type": "drupal-module", + "license": "GPL-2.0-or-later", + "require": { + "drupal/embed": "^1.5" + }, + "require-dev": { + "drupal/entity_browser": "^2.2" + } } diff --git a/web/modules/entity_embed/entity_embed.info.yml b/web/modules/entity_embed/entity_embed.info.yml index 8848b19847cc86df3d300847ed72e6a55708f713..035b38a1a0ad088dbd833a86009943ee9e3f763b 100644 --- a/web/modules/entity_embed/entity_embed.info.yml +++ b/web/modules/entity_embed/entity_embed.info.yml @@ -1,17 +1,15 @@ name: Entity Embed type: module description: 'Allows entities to be embedded using a text editor.' -core_version_requirement: ^8.8 || ^9 +core_version_requirement: ^9.3 package: Filters dependencies: - drupal:editor - embed:embed - drupal:filter - drupal:system -test_dependencies: - - entity_browser:entity_browser -# Information added by Drupal.org packaging script on 2021-09-15 -version: '8.x-1.2' +# Information added by Drupal.org packaging script on 2022-10-20 +version: '8.x-1.3' project: 'entity_embed' -datestamp: 1631711006 +datestamp: 1666275544 diff --git a/web/modules/entity_embed/entity_embed.libraries.yml b/web/modules/entity_embed/entity_embed.libraries.yml index d56978dc70481de0f55ce9d4bdf2f3b052ff8491..c92858a6a8d842734c914bea60058ff4925561f8 100644 --- a/web/modules/entity_embed/entity_embed.libraries.yml +++ b/web/modules/entity_embed/entity_embed.libraries.yml @@ -8,6 +8,7 @@ drupal.entity_embed.dialog: dependencies: - core/drupal - core/jquery + - core/once caption: version: VERSION diff --git a/web/modules/entity_embed/entity_embed.module b/web/modules/entity_embed/entity_embed.module index 2889c503b6f7ea3ac442f95087891653e1d033d3..89e28c09bac388ed30e4ff99a4e5c31f93e51573 100644 --- a/web/modules/entity_embed/entity_embed.module +++ b/web/modules/entity_embed/entity_embed.module @@ -5,6 +5,7 @@ * Framework for allowing entities to be embedded in CKEditor. */ +use Drupal\Component\Serialization\Json; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Field\FieldItemListInterface; @@ -55,6 +56,11 @@ function template_preprocess_entity_embed_container(array &$variables) { $variables['element'] += ['#attributes' => []]; $variables['attributes'] = $variables['element']['#attributes']; $variables['children'] = $variables['element']['#children']; + + // Ensure the display settings get converted to a JSON string again. + if (isset($variables['attributes']['data-entity-embed-display-settings']) && is_array($variables['attributes']['data-entity-embed-display-settings'])) { + $variables['attributes']['data-entity-embed-display-settings'] = Json::encode($variables['attributes']['data-entity-embed-display-settings']); + } } /** @@ -152,7 +158,7 @@ function entity_embed_filter_format_edit_form_validate($form, FormStateInterface 'status', ]); - if ($entity_embed_enabled && $filter_html_enabled && $allowed_html = $form_state->getValue($allowed_html_path)) { + if ($entity_embed_enabled && $filter_html_enabled && $form_state->getValue($allowed_html_path)) { if ($button_groups = $form_state->getValue($button_group_path)) { $buttons = []; $button_groups = json_decode($button_groups, TRUE); @@ -280,21 +286,15 @@ function entity_embed_filter_format_edit_form_validate($form, FormStateInterface } /** - * Implements hook_field_widget_form_alter(). + * Implements hook_field_widget_single_element_form_alter(). */ -function entity_embed_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) { +function entity_embed_field_widget_single_element_form_alter(&$element, FormStateInterface $form_state, $context) { // Add a `data-entity_embed-host-entity-langcode` attribute so that // entity_embed's JavaScript can pass the host entity's language to // EntityEmbedDialog, allowing it to present entities in the same language. - if (!empty($element['#type']) && $element['#type'] == 'text_format') { - if (!empty($context['items']) && $context['items'] instanceof FieldItemListInterface) { - $element['#attributes']['data-entity_embed-host-entity-langcode'] = $context['items']->getLangcode(); - } - else { - $entity = $form_state->getFormObject()->getEntity(); - if ($entity instanceof ContentEntityInterface) { - $element['#attributes']['data-entity_embed-host-entity-langcode'] = $entity->language()->getId(); - } - } + if (isset($element['#type']) && $element['#type'] === 'text_format') { + /** @var FieldItemListInterface $items */ + $items = $context['items']; + $element['#attributes']['data-entity_embed-host-entity-langcode'] = $items->getEntity()->language()->getId(); } } diff --git a/web/modules/entity_embed/entity_embed.routing.yml b/web/modules/entity_embed/entity_embed.routing.yml index 57b67103c40c81dbb774f2664f3b339b3f00a47b..b3fe16fa2c3343cb69830291e3ec4ad1385e0d23 100644 --- a/web/modules/entity_embed/entity_embed.routing.yml +++ b/web/modules/entity_embed/entity_embed.routing.yml @@ -5,10 +5,3 @@ entity_embed.dialog: _title: 'Embed entity' requirements: _embed_button_editor_access: 'TRUE' - -entity_embed.preview: - path: '/entity-embed/preview/{filter_format}' - defaults: - _controller: '\Drupal\entity_embed\Controller\PreviewController::preview' - requirements: - _entity_access: 'filter_format.use' diff --git a/web/modules/entity_embed/js/entity_embed.dialog.js b/web/modules/entity_embed/js/entity_embed.dialog.js index 42a94b0b9fafb86fbd10e02e264f682fcf699caf..59ace6295103f01a0754a1eac988031985ef3743 100644 --- a/web/modules/entity_embed/js/entity_embed.dialog.js +++ b/web/modules/entity_embed/js/entity_embed.dialog.js @@ -6,7 +6,7 @@ * embed dialog. */ -(function ($, Drupal) { +(function ($, Drupal, once) { "use strict"; @@ -27,7 +27,7 @@ */ Drupal.behaviors.entityEmbedDialog = { attach: function (context, settings) { - $('body').once('js-entity-embed-dialog').on('entityBrowserIFrameAppend', function () { + $(once('js-entity-embed-dialog', 'body')).on('entityBrowserIFrameAppend', function () { $('.entity-select-dialog').trigger('resize'); // Hide the next button, the click is triggered by Drupal.entityEmbedDialog.selectionCompleted. $('#drupal-modal').parent().find('.js-button-next').addClass('visually-hidden'); @@ -52,4 +52,4 @@ } }; -})(jQuery, Drupal); +})(jQuery, Drupal, once); diff --git a/web/modules/entity_embed/js/plugins/drupalentity/entity.png b/web/modules/entity_embed/js/plugins/drupalentity/entity.png index 6960acd694da43010f15623f4f60c39d9b3aa13a..6134c6de61159cdddd16dfc6fbb6cd3296c88b6a 100644 --- a/web/modules/entity_embed/js/plugins/drupalentity/entity.png +++ b/web/modules/entity_embed/js/plugins/drupalentity/entity.png @@ -1,33 +1,3 @@ �PNG -��� IHDR�����������a�� -AiCCPICC Profile��H ��wTS��Ͻ7��" %�z �;HQ�I�P��&vDF)VdT�G�"cE��b� �P��QDE�k �5�ޚ��Y�����g�}�P���tX�4�X���\���X��ffG�D���=���HƳ��.�d��,�P&s���"7C$� -E�6<~&��S��2����)2�12� ��"�įl���+�ɘ�&�Y��4���Pޚ%ᣌ�\�%�g�|e�TI����(����L�0�_��&�l�2E�����9�r��9h��x�g��Ib�טi���f��S�b1+��M�xL����0��o�E%Ym�h�����Y��h����~S�=�z�U�&�ϞA��Y�l�/���$Z����U��m@��O� ����ޜ��l^���'���ls�k.+�7���oʿ�9�����V;�?�#I3eE妧�KD����d�����9i���,�����UQ� ��h��<�X�.d -���6'~�khu_�}�9P�I�o=�C#$n?z}�[1 -Ⱦ�h���s�2z���\�n�LA"S���dr%�,�߄l��t� -4�.0,` �3p� ���H�.Hi@�A>�� -A1�v�jp�ԁz�N�6p\W� p�G@ -��K0ށi���A����B�ZyCAP8�C���@��&�*���CP=�#t�]���� 4�}���a ����ٰ;G���Dx����J�>�����,�_@��FX�DB�X$!k�"��E�����H�q���a���Y��bVa�bJ0c�VL�6f3����bձ�X'�?v 6��-�V`�`[����a�;���p~�\2n5������ �&�x�*���s�b|!� -ߏƿ'� Zk�!� $l$T����4Q��Ot"�y�\b)���A�I&N�I�$R$)���TIj"]&=&�!��:dGrY@^O�$� _%�?P�(&OJEB�N9J�@y@yC�R �n�X����ZO�D}J}/G�3���ɭ���k��{%O�חw�_.�'_!J����Q�@�S���V�F��=�IE���b�b�b�b��5�Q%�����O�@��%�!BӥyҸ�M�:�e�0G7��ӓ����� e%e[�(����R�0`�3R��������4�����6�i^��)��*n*|�"�f����LUo�՝�m�O�0j&jaj�j��.��ϧ�w�ϝ_4����갺�z��j���=���U�4�5�n�ɚ��4ǴhZ�Z�Z�^0����Tf%��9�����-�>�ݫ=�c��Xg�N��]�.[7A�\�SwBOK/X/_�Q�>Q�����G�[��� �`�A�������a�a��c#����*�Z�;�8c�q��>�[&���I�I��MS���T`�ϴ�k�h&4�5�Ǣ��YY�F֠9�<�|�y��+=�X���_,�,S-�,Y)YXm�����Ěk]c}džj�c�Φ�浭�-�v��};�]���N����"�&�1=�x����tv(��}�������'{'��I�ߝY�)� Σ��-r�q�r�.d.�_xp��Uە�Z���M�v�m���=����+K�G�ǔ����^���W�W����b�j�>:>�>�>�v��}/�a��v���������O8� � -�FV>2 u�����/�_$\�B�Cv�< 5]�s.,4�&�y�Ux~xw-bEDCĻH����G��KwF�G�E�GME{E�EK�X,Y��F�Z� �={$vr����K���� -��.3\����r���Ϯ�_�Yq*���©�L��_�w�ד������+��]�e�������D��]�cI�II�OA��u�_�䩔���)3�ѩ�i�����B%a��+]3='�/�4�0C��i��U�@ёL(sYf����L�H�$�%�Y�j��gGe��Q�����n�����~5f5wug�v����5�k��֮\۹Nw]������m mH���Fˍe�n���Q�Q��`h����B�BQ�-�[l�ll��f��jۗ"^��b���O%ܒ��Y}W�����������w�vw����X�bY^�Ю�]�����W�Va[q`i�d��2���J�jGէ������{������m���>���Pk�Am�a�����꺿g_D�H��G�G��u�;��7�7�6�Ʊ�q�o���C{��P3���8!9�����<�y�}��'�����Z�Z���։��6i{L{��ӝ�-?��|������gKϑ���9�w~�Bƅ��:Wt>���ҝ����ˁ��^�r�۽��U��g�9];}�}��������_�~i��m��p���㭎�}��]�/���}������.�{�^�=�}����^?�z8�h�c��' -O*��?�����f�����`ϳ�g���C/����O�ϩ�+F�F�G�Gό���z����ˌ��ㅿ)����ѫ�~w��gb���k��?Jި�9���m�d���wi獵�ޫ�?�����c�Ǒ��O�O���?w| ��x&mf������2:Y~��� pHYs����������iTXtXML:com.adobe.xmp�����<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0"> - <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <rdf:Description rdf:about="" - xmlns:xmp="http://ns.adobe.com/xap/1.0/" - xmlns:tiff="http://ns.adobe.com/tiff/1.0/" - xmlns:exif="http://ns.adobe.com/exif/1.0/"> - <xmp:ModifyDate>2014-02-07T20:02:30</xmp:ModifyDate> - <xmp:CreatorTool>Pixelmator 3.1</xmp:CreatorTool> - <tiff:Orientation>1</tiff:Orientation> - <tiff:Compression>5</tiff:Compression> - <tiff:ResolutionUnit>1</tiff:ResolutionUnit> - <tiff:YResolution>72</tiff:YResolution> - <tiff:XResolution>72</tiff:XResolution> - <exif:PixelXDimension>16</exif:PixelXDimension> - <exif:ColorSpace>1</exif:ColorSpace> - <exif:PixelYDimension>16</exif:PixelYDimension> - </rdf:Description> - </rdf:RDF> -</x:xmpmeta> -=�Q����wIDAT8c`��*�Q����ȎfA栱� �~���a.�D���g�&H�>/� J�b�f��+,�p!�p�%\%��� �n +���bC���>�Hq,��ʁyW �G�D [@{6��.%�(��x����IEND�B`� \ No newline at end of file +��� IHDR�����������7����?IDAT(�c`����.Ǧ�'�g8\�MA%!+*Xǐ�b�i�M��5p�FGV���IV@.��X�@5��������IEND�B`� \ No newline at end of file diff --git a/web/modules/entity_embed/js/plugins/drupalentity/plugin.js b/web/modules/entity_embed/js/plugins/drupalentity/plugin.js index e5a9c4065bc6a135b163668ae07e74d7b757e98b..58a1e81f338d992fa345097a97b704bd90996c1c 100644 --- a/web/modules/entity_embed/js/plugins/drupalentity/plugin.js +++ b/web/modules/entity_embed/js/plugins/drupalentity/plugin.js @@ -321,11 +321,11 @@ _loadPreview: function (callback) { var widget = this; jQuery.get({ - url: Drupal.url('entity-embed/preview/' + editor.config.drupal.format + '?text=' + encodeURIComponent(this.downcast().getOuterHtml())), + url: Drupal.url('embed/preview/' + editor.config.drupal.format + '?text=' + encodeURIComponent(this.downcast().getOuterHtml())), dataType: 'html', headers: { - 'X-Drupal-EntityPreview-CSRF-Token': editor.config.drupalEntity_previewCsrfToken, - } + 'X-Drupal-EmbedPreview-CSRF-Token': editor.config.DrupalEntity_previewCsrfToken + }, }).done(function(previewHtml) { widget.element.setHtml(previewHtml); callback(widget); diff --git a/web/modules/entity_embed/src/Controller/PreviewController.php b/web/modules/entity_embed/src/Controller/PreviewController.php deleted file mode 100644 index e6bc8ab2adb350072556a061733afa49776f826b..0000000000000000000000000000000000000000 --- a/web/modules/entity_embed/src/Controller/PreviewController.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php - -namespace Drupal\entity_embed\Controller; - -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; -use Drupal\Core\Render\RendererInterface; -use Drupal\Core\Session\AccountInterface; -use Drupal\filter\FilterFormatInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; - -/** - * Controller which renders a preview of the provided text. - */ -class PreviewController implements ContainerInjectionInterface { - - /** - * The renderer service. - * - * @var \Drupal\Core\Render\RendererInterface - */ - protected $renderer; - - /** - * Constructs an PreviewController instance. - * - * @param \Drupal\Core\Render\RendererInterface $renderer - * The renderer service. - */ - public function __construct(RendererInterface $renderer) { - $this->renderer = $renderer; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container) { - return new static( - $container->get('renderer') - ); - } - - /** - * Returns a HTML response containing a preview of the text after filtering. - * - * Applies all of the given text format's filters, not just the `entity_embed` - * filter, because for example `filter_align` and `filter_caption` may apply - * to it as well. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * The request object. - * @param \Drupal\filter\FilterFormatInterface $filter_format - * The text format. - * - * @return \Symfony\Component\HttpFoundation\Response - * The filtered text. - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - * Throws an exception if 'text' parameter is not found in the request. - * - * @see \Drupal\editor\EditorController::getUntransformedText - */ - public function preview(Request $request, FilterFormatInterface $filter_format) { - self::checkCsrf($request, \Drupal::currentUser()); - - $text = $request->get('text'); - if ($text == '') { - throw new NotFoundHttpException(); - } - - $build = [ - '#type' => 'processed_text', - '#text' => $text, - '#format' => $filter_format->id(), - ]; - $html = $this->renderer->renderPlain($build); - - // Note that we intentionally do not use: - // - \Drupal\Core\Cache\CacheableResponse because caching it on the server - // side is wasteful, hence there is no need for cacheability metadata. - // - \Drupal\Core\Render\HtmlResponse because there is no need for - // attachments nor cacheability metadata. - return (new Response($html)) - // Do not allow any intermediary to cache the response, only the end user. - ->setPrivate() - // Allow the end user to cache it for up to 5 minutes. - ->setMaxAge(300); - } - - /** - * Throws an AccessDeniedHttpException if the request fails CSRF validation. - * - * This is used instead of \Drupal\Core\Access\CsrfAccessCheck, in order to - * allow access for anonymous users. - * - * @todo Refactor this to an access checker. - */ - private static function checkCsrf(Request $request, AccountInterface $account) { - $header = 'X-Drupal-EntityPreview-CSRF-Token'; - - if (!$request->headers->has($header)) { - throw new AccessDeniedHttpException(); - } - if ($account->isAnonymous()) { - // For anonymous users, just the presence of the custom header is - // sufficient protection. - return; - } - // For authenticated users, validate the token value. - $token = $request->headers->get($header); - if (!\Drupal::csrfToken()->validate($token, $header)) { - throw new AccessDeniedHttpException(); - } - } - -} diff --git a/web/modules/entity_embed/src/EntityEmbedBuilder.php b/web/modules/entity_embed/src/EntityEmbedBuilder.php index 892ec3acb599fcbf3085a6bcac8d72dff7d31364..1b1188c2e71b7a09bf57a372e094c362653d6b4a 100644 --- a/web/modules/entity_embed/src/EntityEmbedBuilder.php +++ b/web/modules/entity_embed/src/EntityEmbedBuilder.php @@ -59,15 +59,19 @@ public function buildEntityEmbed(EntityInterface $entity, array $context = []) { 'data-entity-embed-display-settings' => [], ]; - // If the data-entity-embed-display-settings isn't an array reset it, + // If the data-entity-embed-display-settings isn't an array, reset it, // otherwise we'll encounter a fatal error when calling // $this->buildEntityEmbedDisplayPlugin() further down the line. if (!is_array($context['data-entity-embed-display-settings'])) { - \Drupal::logger('entity_embed')->warning('Invalid display settings encountered. Could not process following settings for entity type "@entity_type" with the uuid "@uuid": @settings', [ - '@settings' => $context['data-entity-embed-display-settings'], - '@entity_type' => $entity->getEntityTypeId(), - '@uuid' => $entity->uuid(), - ]); + // Log a warning if it was set to a some non-empty value, which is an + // invalid config value that admins should be made aware of. + if (!empty($context['data-entity-embed-display-settings'])) { + \Drupal::logger('entity_embed')->warning('Invalid display settings encountered. Could not process following settings for entity type "@entity_type" with the uuid "@uuid": @settings', [ + '@settings' => $context['data-entity-embed-display-settings'], + '@entity_type' => $entity->getEntityTypeId(), + '@uuid' => $entity->uuid(), + ]); + } $context['data-entity-embed-display-settings'] = []; } diff --git a/web/modules/entity_embed/src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php b/web/modules/entity_embed/src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php index 038bba243568d17ee48c22524c0ca7ff0b75c184..99b6e244542b1bcd8e7fb32e2cd15f4f3b87a5ce 100644 --- a/web/modules/entity_embed/src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php +++ b/web/modules/entity_embed/src/EntityEmbedDisplay/FieldFormatterEntityEmbedDisplayBase.php @@ -48,44 +48,14 @@ abstract class FieldFormatterEntityEmbedDisplayBase extends EntityEmbedDisplayBa */ protected $fieldFormatter; - /** - * Constructs a FieldFormatterEntityEmbedDisplayBase object. - * - * @param array $configuration - * A configuration array containing information about the plugin instance. - * @param string $plugin_id - * The plugin_id for the plugin instance. - * @param mixed $plugin_definition - * The plugin implementation definition. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity type manager service. - * @param \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager - * The field formatter plugin manager. - * @param \Drupal\Core\TypedData\TypedDataManager $typed_data_manager - * The typed data manager. - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager - * The language manager. - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, FormatterPluginManager $formatter_plugin_manager, TypedDataManager $typed_data_manager, LanguageManagerInterface $language_manager) { - $this->formatterPluginManager = $formatter_plugin_manager; - $this->setConfiguration($configuration); - $this->typedDataManager = $typed_data_manager; - parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $language_manager); - } - /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager'), - $container->get('plugin.manager.field.formatter'), - $container->get('typed_data_manager'), - $container->get('language_manager') - ); + $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition); + $instance->formatterPluginManager = $container->get('plugin.manager.field.formatter'); + $instance->typedDataManager = $container->get('typed_data_manager'); + return $instance; } /** @@ -130,7 +100,7 @@ public function access(AccountInterface $account = NULL) { * Returns the access result. */ protected function isApplicableFieldFormatter() { - $definition = $this->formatterPluginManager->getDefinition($this->getFieldFormatterId()); + $definition = $this->formatterPluginManager()->getDefinition($this->getFieldFormatterId()); return AccessResult::allowedIf($definition['class']::isApplicable($this->getFieldDefinition())); } @@ -180,7 +150,7 @@ public function build() { * {@inheritdoc} */ public function defaultConfiguration() { - return $this->formatterPluginManager->getDefaultSettings($this->getFieldFormatterId()); + return $this->formatterPluginManager()->getDefaultSettings($this->getFieldFormatterId()); } /** @@ -240,11 +210,27 @@ protected function createFieldDefinition($type) { public function calculateDependencies() { $this->addDependencies(parent::calculateDependencies()); - $definition = $this->formatterPluginManager->getDefinition($this->getFieldFormatterId()); + $definition = $this->formatterPluginManager()->getDefinition($this->getFieldFormatterId()); $this->addDependency('module', $definition['provider']); // @todo Investigate why this does not work currently. // $this->calculatePluginDependencies($this->getFieldFormatter()); return $this->dependencies; } + /** + * Gets the field formatter plugin manager. + * + * This is needed for the defaultConfiguration() method since that gets + * invoked via the constructor, and our services are injected after the + * constructor are called. + * + * @return \Drupal\Core\Field\FormatterPluginManager + */ + public function formatterPluginManager() { + if (!isset($this->formatterPluginManager)) { + $this->formatterPluginManager = \Drupal::service('plugin.manager.field.formatter'); + } + return $this->formatterPluginManager; + } + } diff --git a/web/modules/entity_embed/src/Form/EntityEmbedDialog.php b/web/modules/entity_embed/src/Form/EntityEmbedDialog.php index cc9daaf6eb612660b78497308ab836c26c91ee10..5ae3b114646a8eb969d4fe902e7bce161bdec6eb 100644 --- a/web/modules/entity_embed/src/Form/EntityEmbedDialog.php +++ b/web/modules/entity_embed/src/Form/EntityEmbedDialog.php @@ -122,8 +122,7 @@ public static function create(ContainerInterface $container) { $container->get('entity_type.manager'), $container->get('event_dispatcher'), $container->get('entity_field.manager'), - $container->get('module_handler'), - $container->get('language_manager') + $container->get('module_handler') ); } @@ -492,7 +491,7 @@ public function buildEmbedStep(array $form, FormStateInterface $form_state) { $entity_element['data-entity-embed-display-settings'] = []; } elseif (is_string($entity_element['data-entity-embed-display-settings'])) { - $entity_element['data-entity-embed-display-settings'] = Json::decode($entity_element['data-entity-embed-display-settings']); + $entity_element['data-entity-embed-display-settings'] = Json::decode($entity_element['data-entity-embed-display-settings']) ?: []; } $display = $this->entityEmbedDisplayManager->createInstance($plugin_id, $entity_element['data-entity-embed-display-settings']); $display->setContextValue('entity', $entity); diff --git a/web/modules/entity_embed/src/Plugin/CKEditorPlugin/DrupalEntity.php b/web/modules/entity_embed/src/Plugin/CKEditorPlugin/DrupalEntity.php index 236e8da431553a8bb741084132a6ba0a774f2a8f..f6a0565ecb37e82647395e1ea6157f03b0d66af9 100644 --- a/web/modules/entity_embed/src/Plugin/CKEditorPlugin/DrupalEntity.php +++ b/web/modules/entity_embed/src/Plugin/CKEditorPlugin/DrupalEntity.php @@ -31,18 +31,7 @@ protected function getButton(EmbedButtonInterface $embed_button) { * {@inheritdoc} */ public function getFile() { - return drupal_get_path('module', 'entity_embed') . '/js/plugins/drupalentity/plugin.js'; - } - - /** - * {@inheritdoc} - */ - public function getLibraries(Editor $editor) { - return [ - 'core/jquery', - 'core/drupal', - 'core/drupal.ajax', - ]; + return $this->getModulePath('entity_embed') . '/js/plugins/drupalentity/plugin.js'; } /** @@ -53,7 +42,7 @@ public function getConfig(Editor $editor) { 'DrupalEntity_dialogTitleAdd' => t('Insert entity'), 'DrupalEntity_dialogTitleEdit' => t('Edit entity'), 'DrupalEntity_buttons' => $this->getButtons(), - 'drupalEntity_previewCsrfToken' => \Drupal::csrfToken()->get('X-Drupal-EntityPreview-CSRF-Token'), + 'DrupalEntity_previewCsrfToken' => \Drupal::csrfToken()->get('X-Drupal-EmbedPreview-CSRF-Token'), ]; } @@ -62,8 +51,8 @@ public function getConfig(Editor $editor) { */ public function getCssFiles(Editor $editor) { return [ - drupal_get_path('module', 'system') . '/css/components/hidden.module.css', - drupal_get_path('module', 'entity_embed') . '/css/entity_embed.editor.css', + $this->getModulePath('system') . '/css/components/hidden.module.css', + $this->getModulePath('entity_embed') . '/css/entity_embed.editor.css', ]; } diff --git a/web/modules/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php b/web/modules/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php index b9e3d3ddc94988fbb328faab2a4a26457dd6ac3a..9e79f7dc8e7af2e8b2b2dea06c4d0e2f0eb93de3 100644 --- a/web/modules/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php +++ b/web/modules/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php @@ -35,46 +35,13 @@ class EntityReferenceFieldFormatter extends FieldFormatterEntityEmbedDisplayBase */ protected $configFactory; - /** - * Constructs a new EntityReferenceFieldFormatter. - * - * @param array $configuration - * A configuration array containing information about the plugin instance. - * @param string $plugin_id - * The plugin_id for the plugin instance. - * @param mixed $plugin_definition - * The plugin implementation definition. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity type manager service. - * @param \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager - * The field formatter plugin manager. - * @param \Drupal\Core\TypedData\TypedDataManager $typed_data_manager - * The typed data manager. - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager - * The language manager. - * @param \Drupal\Core\Config\ConfigFactoryInterface|null $config_factory - * The configuration factory, or null to get from global container for - * backwards compatibility. - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, FormatterPluginManager $formatter_plugin_manager, TypedDataManager $typed_data_manager, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory = NULL) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $formatter_plugin_manager, $typed_data_manager, $language_manager); - $this->configFactory = $config_factory instanceof ConfigFactoryInterface ? $config_factory : \Drupal::configFactory(); - } - /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager'), - $container->get('plugin.manager.field.formatter'), - $container->get('typed_data_manager'), - $container->get('language_manager'), - $container->get('config.factory') - ); + $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition); + $instance->configFactory = $container->get('config.factory'); + return $instance; } /** diff --git a/web/modules/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php b/web/modules/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php index c175ded4780aa8bfb1f3e6b18590844b038c5c36..fd2392328b2ce7ad7ac23be9e25eb10f57ce461a 100644 --- a/web/modules/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php +++ b/web/modules/entity_embed/src/Plugin/entity_embed/EntityEmbedDisplay/ImageFieldFormatter.php @@ -43,49 +43,14 @@ class ImageFieldFormatter extends FileFieldFormatter { */ protected $messenger; - /** - * Constructs an ImageFieldFormatter object. - * - * @param array $configuration - * A configuration array containing information about the plugin instance. - * @param string $plugin_id - * The plugin_id for the plugin instance. - * @param mixed $plugin_definition - * The plugin implementation definition. - * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager - * The entity manager service. - * @param \Drupal\Core\Field\FormatterPluginManager $formatter_plugin_manager - * The field formatter plugin manager. - * @param \Drupal\Core\TypedData\TypedDataManager $typed_data_manager - * The typed data manager. - * @param \Drupal\Core\Image\ImageFactory $image_factory - * The image factory. - * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager - * The language manager. - * @param \Drupal\Core\Messenger\MessengerInterface $messenger - * The messenger. - */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, FormatterPluginManager $formatter_plugin_manager, TypedDataManager $typed_data_manager, ImageFactory $image_factory, LanguageManagerInterface $language_manager, MessengerInterface $messenger) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $formatter_plugin_manager, $typed_data_manager, $language_manager); - $this->imageFactory = $image_factory; - $this->messenger = $messenger; - } - /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('entity_type.manager'), - $container->get('plugin.manager.field.formatter'), - $container->get('typed_data_manager'), - $container->get('image.factory'), - $container->get('language_manager'), - $container->get('messenger') - ); + $instance = parent::create($container, $configuration, $plugin_id, $plugin_definition); + $instance->imageFactory = $container->get('image.factory'); + $instance->messenger = $container->get('messenger'); + return $instance; } /** diff --git a/web/modules/entity_embed/tests/modules/entity_embed_test/entity_embed_test.info.yml b/web/modules/entity_embed/tests/modules/entity_embed_test/entity_embed_test.info.yml index 8945177927f2a4d58dc5652d7c1cc9ec5d5eeeed..2692d6ba09ccfd4e30a50f70337e42fa5ee182f1 100644 --- a/web/modules/entity_embed/tests/modules/entity_embed_test/entity_embed_test.info.yml +++ b/web/modules/entity_embed/tests/modules/entity_embed_test/entity_embed_test.info.yml @@ -13,7 +13,7 @@ dependencies: - embed:embed - entity_embed:entity_embed -# Information added by Drupal.org packaging script on 2021-09-15 -version: '8.x-1.2' +# Information added by Drupal.org packaging script on 2022-10-20 +version: '8.x-1.3' project: 'entity_embed' -datestamp: 1631711006 +datestamp: 1666275544 diff --git a/web/modules/entity_embed/tests/modules/entity_embed_test/entity_embed_test.module b/web/modules/entity_embed/tests/modules/entity_embed_test/entity_embed_test.module index a8ecd923fbbdadf1d68fd1539a38a19cb17c21cc..e1cce52b729ff8555b3ae428e966322c6feb195f 100644 --- a/web/modules/entity_embed/tests/modules/entity_embed_test/entity_embed_test.module +++ b/web/modules/entity_embed/tests/modules/entity_embed_test/entity_embed_test.module @@ -91,7 +91,8 @@ function entity_embed_test_entity_access(EntityInterface $entity, $operation, Ac * Implements hook_entity_view_alter(). */ function entity_embed_test_entity_view_alter(&$build, EntityInterface $entity, EntityViewDisplayInterface $display) { - $build['#attributes']['data-entity-embed-test-view-mode'] = $display->getMode(); + $build['#attributes']['data-entity-embed-test-uuid'] = $entity->uuid(); + $build['#attributes']['data-entity-embed-test-view-mode'] = $build['#view_mode']; // @see \Drupal\Tests\entity_embed\FunctionalJavascript\MediaImageTest::testPreviewUsesDefaultTheme() $build['#attributes']['data-entity-embed-test-active-theme'] = \Drupal::theme()->getActiveTheme()->getName(); } diff --git a/web/modules/entity_embed/tests/modules/entity_embed_translation_test/entity_embed_translation_test.info.yml b/web/modules/entity_embed/tests/modules/entity_embed_translation_test/entity_embed_translation_test.info.yml index fa9cc1446215dc185d937a644f3ecf95b770ea65..c9f9bd1ed856b9c046a94ddf8bf7a5f9ef731b71 100644 --- a/web/modules/entity_embed/tests/modules/entity_embed_translation_test/entity_embed_translation_test.info.yml +++ b/web/modules/entity_embed/tests/modules/entity_embed_translation_test/entity_embed_translation_test.info.yml @@ -14,7 +14,7 @@ dependencies: - embed:embed - entity_embed:entity_embed -# Information added by Drupal.org packaging script on 2021-09-15 -version: '8.x-1.2' +# Information added by Drupal.org packaging script on 2022-10-20 +version: '8.x-1.3' project: 'entity_embed' -datestamp: 1631711006 +datestamp: 1666275544 diff --git a/web/modules/entity_embed/tests/src/Functional/EntityEmbedDialogTest.php b/web/modules/entity_embed/tests/src/Functional/EntityEmbedDialogTest.php index 67d305c0f209727fa9a08cb4343c75b7bc881ae3..a781d0a03b48075e5b1bc9041a2a85479d995fae 100644 --- a/web/modules/entity_embed/tests/src/Functional/EntityEmbedDialogTest.php +++ b/web/modules/entity_embed/tests/src/Functional/EntityEmbedDialogTest.php @@ -113,7 +113,7 @@ public function testEntityEmbedFunctionality() { 'entity_id' => $this->node->getTitle() . ' (' . $this->node->id() . ')', ]; $this->drupalGet('/entity-embed/dialog/custom_format/node'); - $this->drupalPostForm(NULL, $edit, t('Next')); + $this->submitForm($edit, 'Next'); // Tests that the embed dialog doesn't trow a fatal in // ImageFieldFormatter::isValidImage() $this->assertSession()->statusCodeEquals(200); diff --git a/web/modules/entity_embed/tests/src/Functional/EntityEmbedDisplayManagerTest.php b/web/modules/entity_embed/tests/src/Functional/EntityEmbedDisplayManagerTest.php index c1e1bded55279fc6fc13eb0ce06ec2ae261ddc29..c18ab258eb69ce5c72b40a6e878b3a1595d659ea 100644 --- a/web/modules/entity_embed/tests/src/Functional/EntityEmbedDisplayManagerTest.php +++ b/web/modules/entity_embed/tests/src/Functional/EntityEmbedDisplayManagerTest.php @@ -82,10 +82,7 @@ protected function setUp() { $this->imageButton->save(); // Create a sample image to embed. - $entity_embed_path = $this->container->get('module_handler') - ->getModule('entity_embed') - ->getPath(); - \Drupal::service('file_system')->copy($entity_embed_path . '/js/plugins/drupalentity/entity.png', 'public://example1.png'); + \Drupal::service('file_system')->copy('core/tests/fixtures/files/image-1.png', 'public://example1.png'); // Resize the test image so that it will be scaled down during token // replacement. diff --git a/web/modules/entity_embed/tests/src/Functional/EntityEmbedUpdateHookTest.php b/web/modules/entity_embed/tests/src/Functional/EntityEmbedUpdateHookTest.php index afa86b3e55ec0cd6a73a6e81432dddb72e252441..5c020744ff3f747135e369eda0058e535aa49f53 100644 --- a/web/modules/entity_embed/tests/src/Functional/EntityEmbedUpdateHookTest.php +++ b/web/modules/entity_embed/tests/src/Functional/EntityEmbedUpdateHookTest.php @@ -11,6 +11,11 @@ */ class EntityEmbedUpdateHookTest extends UpdatePathTestBase { + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'stark'; + /** * Set database dump files to be used. */ @@ -40,8 +45,8 @@ protected function setUp() { */ protected function doSelectionTest() { parent::doSelectionTest(); - $this->assertSession()->responseContains('8002 - Updates the default mode settings.'); - $this->assertSession()->responseContains('8003 - Updates allowed HTML for all filter configs that have an Entity Embed button.'); + $this->assertSession()->responseMatches('/8002\s*-\s*Updates the default mode settings./'); + $this->assertSession()->responseMatches('/8003\s*-\s*Updates allowed HTML for all filter configs that have an Entity Embed button./'); } /** diff --git a/web/modules/entity_embed/tests/src/Functional/FileFieldFormatterTest.php b/web/modules/entity_embed/tests/src/Functional/FileFieldFormatterTest.php index 07b78da5b5e7f51560463c8b174b53a0c36c7308..351ba1b5d31ec5504c46de43f66d5581c022568c 100644 --- a/web/modules/entity_embed/tests/src/Functional/FileFieldFormatterTest.php +++ b/web/modules/entity_embed/tests/src/Functional/FileFieldFormatterTest.php @@ -81,7 +81,7 @@ public function testFileFieldFormatter() { // Verify description of the embedded file exists in page. $this->assertSession()->responseContains($embed_settings['description']); $this->assertSession()->responseNotContains('This placeholder should not be rendered.'); - $this->assertSession()->linkByHrefExists(file_create_url($this->file->getFileUri()), 0, 'Link to the embedded file exists.'); + $this->assertSession()->linkByHrefExists(file_url_transform_relative(file_create_url($this->file->getFileUri())), 0, 'Link to the embedded file exists.'); } } diff --git a/web/modules/entity_embed/tests/src/Functional/ImageFieldFormatterTest.php b/web/modules/entity_embed/tests/src/Functional/ImageFieldFormatterTest.php index d45d50624dae4b4ca58703446cdf241083241969..95cbc305961349d6d8754a3d7e9a14eacd81ca46 100644 --- a/web/modules/entity_embed/tests/src/Functional/ImageFieldFormatterTest.php +++ b/web/modules/entity_embed/tests/src/Functional/ImageFieldFormatterTest.php @@ -64,12 +64,24 @@ public function testImageFieldFormatter() { ->createInstance('image:image', []); $display->setContextValue('entity', $this->image); $conf_form = $display->buildConfigurationForm($form, $form_state); - $expected = [ - 'image_style', - 'image_link', - 'alt', - 'title', - ]; + if (version_compare(\Drupal::VERSION, '9.4', '<')) { + $expected = [ + 'image_style', + 'image_link', + 'alt', + 'title', + ]; + } + else { + // Drupal 9.4+ added a new option to the image formatter settings. + $expected = [ + 'image_style', + 'image_link', + 'image_loading', + 'alt', + 'title', + ]; + } $this->assertSame($expected, array_keys($conf_form)); $this->assertSame('select', $conf_form['image_style']['#type']); $this->assertSame('Image style', (string) $conf_form['image_style']['#title']); @@ -95,7 +107,7 @@ public function testImageFieldFormatter() { // when embed is successful. $this->assertSession()->responseContains($alt_text); $this->assertSession()->responseNotContains('This placeholder should not be rendered.'); - $this->assertSession()->linkByHrefExists(file_create_url($this->image->getFileUri()), 0, 'Link to the embedded image exists.'); + $this->assertSession()->linkByHrefExists(file_url_transform_relative(file_create_url($this->image->getFileUri())), 0, 'Link to the embedded image exists.'); // Embed all three field types in one, to ensure they all render correctly. $content = '<drupal-entity data-entity-type="node" data-entity-uuid="' . $this->node->uuid() . '" data-entity-embed-display="entity_reference:entity_reference_label"></drupal-entity>'; diff --git a/web/modules/entity_embed/tests/src/Functional/ViewModeFieldFormatterTest.php b/web/modules/entity_embed/tests/src/Functional/ViewModeFieldFormatterTest.php index 72079146a1ad56409d948d176f149f084afe8a9d..a5fab132ab39bcd97bbd8c98a3d0a2e38d90f993 100644 --- a/web/modules/entity_embed/tests/src/Functional/ViewModeFieldFormatterTest.php +++ b/web/modules/entity_embed/tests/src/Functional/ViewModeFieldFormatterTest.php @@ -11,11 +11,6 @@ */ class ViewModeFieldFormatterTest extends EntityEmbedTestBase { - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'classy'; - private $plugins = [ 'view_mode:node.full', 'view_mode:node.rss', @@ -53,8 +48,8 @@ public function testFilterViewModePlugins() { $node = $this->drupalCreateNode($settings); $this->drupalGet('node/' . $node->id()); $plugin = explode('.', $plugin); - $view_mode = str_replace('_', '-', end($plugin)); - $this->assertSession()->responseContains('node--view-mode-' . $view_mode, 'Node rendered in the correct view mode: ' . $view_mode . '.'); + $view_mode = end($plugin); + $this->assertSession()->elementExists('css', 'article[data-entity-embed-test-uuid="' . $this->node->uuid() . '"][data-entity-embed-test-view-mode="' . $view_mode . '"]'); } } diff --git a/web/modules/entity_embed/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php b/web/modules/entity_embed/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php index a2a4167a8e2503556c2911006fe76068f5446fc2..b3d1804de15fe15d6537504d822b072b48280a1c 100644 --- a/web/modules/entity_embed/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php +++ b/web/modules/entity_embed/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php @@ -22,6 +22,7 @@ class CKEditorIntegrationTest extends EntityEmbedTestBase { 'node', 'ckeditor', 'views', + 'embed', 'entity_embed', 'entity_embed_test', ]; @@ -34,7 +35,7 @@ class CKEditorIntegrationTest extends EntityEmbedTestBase { /** * The test button. * - * @var Drupal\embed\Entity\EmbedButton + * @var \Drupal\embed\Entity\EmbedButtonInterface */ protected $button; diff --git a/web/modules/entity_embed/tests/src/FunctionalJavascript/ConfigurationUiTest.php b/web/modules/entity_embed/tests/src/FunctionalJavascript/ConfigurationUiTest.php index e23bb50417c7835572b8463e4cd5afb116d29b91..7abdf03be183e8f44a07f9ddb9b2d693376150f7 100644 --- a/web/modules/entity_embed/tests/src/FunctionalJavascript/ConfigurationUiTest.php +++ b/web/modules/entity_embed/tests/src/FunctionalJavascript/ConfigurationUiTest.php @@ -25,7 +25,7 @@ class ConfigurationUiTest extends EntityEmbedTestBase { /** * The test administrative user. * - * @var \Drupal\user\UserInterface + * @var \Drupal\Core\Session\AccountInterface */ protected $adminUser; @@ -85,7 +85,6 @@ protected function setUp() { * The error message that should display. * * @dataProvider providerTestValidations - * @dataProvider providerTestValidationWhenAdding */ public function testValidationWhenAdding($filter_html_status, $entity_embed_status, $allowed_html, $expected_error_message) { $this->drupalGet('admin/config/content/formats/add'); @@ -115,11 +114,14 @@ public function testValidationWhenAdding($filter_html_status, $entity_embed_stat $this->assertSession()->waitForElementVisible('css', $target); $this->sortableTo($item, $from, $target); - if ($allowed_html == 'default' && $entity_embed_status) { - // Unfortunately the <drupal-entity> tag is not yet allowed due to - // https://www.drupal.org/project/drupal/issues/2763075. + if ($allowed_html === 'default' && $entity_embed_status) { $allowed_html = $this->assertSession()->fieldExists('filters[filter_html][settings][allowed_html]')->getValue(); - $this->assertStringNotContainsString('drupal-entity', $allowed_html); + if ($entity_embed_status) { + $this->assertStringContainsString('drupal-entity', $allowed_html); + } + else { + $this->assertStringNotContainsString('drupal-entity', $allowed_html); + } } elseif (!empty($allowed_html)) { $page->fillField('filters[filter_html][settings][allowed_html]', $allowed_html); @@ -136,20 +138,6 @@ public function testValidationWhenAdding($filter_html_status, $entity_embed_stat } } - /** - * Data provider for testValidationWhenAdding(). - */ - public function providerTestValidationWhenAdding() { - return [ - 'Tests validation when drupal-entity not added.' => [ - 'filters[filter_html][status]' => TRUE, - 'filters[entity_embed][status]' => TRUE, - 'allowed_html' => 'default', - 'expected_error_message' => 'The Media Entity Embed button requires <drupal-entity> among the allowed HTML tags.', - ], - ]; - } - /** * Test integration with Filter and Text Editor form validation. * @@ -164,7 +152,6 @@ public function providerTestValidationWhenAdding() { * The error message that should display. * * @dataProvider providerTestValidations - * @dataProvider providerTestValidationWhenEditing */ public function testValidationWhenEditing($filter_html_status, $entity_embed_status, $allowed_html, $expected_error_message) { $this->drupalGet('admin/config/content/formats/manage/embed_test'); @@ -191,9 +178,14 @@ public function testValidationWhenEditing($filter_html_status, $entity_embed_sta $this->assertSession()->waitForElementVisible('css', $target); $this->sortableTo($item, $from, $target); - if ($allowed_html == 'default' && $entity_embed_status) { + if ($allowed_html === 'default' && $entity_embed_status) { $allowed_html = $this->assertSession()->fieldExists('filters[filter_html][settings][allowed_html]')->getValue(); - $this->assertStringContainsString('drupal-entity', $allowed_html); + if ($entity_embed_status) { + $this->assertStringContainsString('drupal-entity', $allowed_html); + } + else { + $this->assertStringNotContainsString('drupal-entity', $allowed_html); + } } elseif (!empty($allowed_html)) { $page->fillField('filters[filter_html][settings][allowed_html]', $allowed_html); @@ -210,20 +202,6 @@ public function testValidationWhenEditing($filter_html_status, $entity_embed_sta } } - /** - * Data provider for testValidationWhenEditing(). - */ - public function providerTestValidationWhenEditing() { - return [ - 'Tests validation when drupal-entity not added.' => [ - 'filters[filter_html][status]' => TRUE, - 'filters[entity_embed][status]' => TRUE, - 'allowed_html' => 'default', - 'expected_error_message' => FALSE, - ], - ]; - } - /** * Data provider for testValidationWhenAdding() and * testValidationWhenEditing(). @@ -248,6 +226,18 @@ public function providerTestValidations() { 'allowed_html' => 'default', 'expected_error_message' => FALSE, ], + 'Tests validation when entity_embed filter enabled and filter_html is enabled.' => [ + 'filters[filter_html][status]' => TRUE, + 'filters[entity_embed][status]' => TRUE, + 'allowed_html' => 'default', + 'expected_error_message' => FALSE, + ], + 'Tests validation when drupal-entity not added.' => [ + 'filters[filter_html][status]' => TRUE, + 'filters[entity_embed][status]' => TRUE, + 'allowed_html' => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>", + 'expected_error_message' => 'The Media Entity Embed button requires <drupal-entity> among the allowed HTML tags.', + ], 'Tests validation when drupal-entity element has no attributes.' => [ 'filters[filter_html][status]' => TRUE, 'filters[entity_embed][status]' => TRUE, diff --git a/web/modules/entity_embed/tests/src/FunctionalJavascript/MediaImageTest.php b/web/modules/entity_embed/tests/src/FunctionalJavascript/MediaImageTest.php index 73fa189deb8a061355112f48d89fd1af088ad476..2b5b798cc759202cdfa31cbb65528c335f03a371 100644 --- a/web/modules/entity_embed/tests/src/FunctionalJavascript/MediaImageTest.php +++ b/web/modules/entity_embed/tests/src/FunctionalJavascript/MediaImageTest.php @@ -716,7 +716,7 @@ public function testPreviewUsesDefaultThemeAndIsClientCacheable() { // Configure a different default and admin theme, like on most Drupal sites. $this->config('system.theme') ->set('default', 'stable') - ->set('admin', 'classy') + ->set('admin', 'stark') ->save(); // Assert that when looking at an embedded entity in the CKEditor Widget, @@ -761,7 +761,7 @@ protected function getLastPreviewRequestTransferSize() { return window.performance .getEntries() .filter(function (entry) { - return entry.initiatorType == 'xmlhttprequest' && entry.name.indexOf('/entity-embed/preview/') !== -1; + return entry.initiatorType == 'xmlhttprequest' && entry.name.indexOf('/embed/preview/') !== -1; }) .pop() .transferSize; diff --git a/web/modules/entity_embed/tests/src/Kernel/EntityEmbedFilterLegacyTest.php b/web/modules/entity_embed/tests/src/Kernel/EntityEmbedFilterLegacyTest.php index f060f90b321f332eb41f1691725e6d7ee9bee352..4f7b10603c8ef307f320d2137c21fde50029d2c5 100644 --- a/web/modules/entity_embed/tests/src/Kernel/EntityEmbedFilterLegacyTest.php +++ b/web/modules/entity_embed/tests/src/Kernel/EntityEmbedFilterLegacyTest.php @@ -35,7 +35,7 @@ public function testEntityIdBackwardsCompatibility() { 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-langcode' => 'en', 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'teaser', + 'data-entity-embed-display-settings' => '{"view_mode":"teaser"}', ]); } @@ -58,7 +58,7 @@ public function testEntityIdIgnoredIfEntityUuidPresent() { 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-langcode' => 'en', 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'teaser', + 'data-entity-embed-display-settings' => '{"view_mode":"teaser"}', ]); } @@ -92,7 +92,7 @@ public function testEntityEmbedDisplayDefaultBackwardsCompatibility() { 'data-entity-type' => 'node', 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'teaser', + 'data-entity-embed-display-settings' => '{"view_mode":"teaser"}', 'data-langcode' => 'en', ]); } diff --git a/web/modules/entity_embed/tests/src/Kernel/EntityEmbedFilterTest.php b/web/modules/entity_embed/tests/src/Kernel/EntityEmbedFilterTest.php index 09ff02db5ba5031c694411e784420caadcb7d4a0..4c1c386bd9412b479f5d28e83b7aeb6af0522bee 100644 --- a/web/modules/entity_embed/tests/src/Kernel/EntityEmbedFilterTest.php +++ b/web/modules/entity_embed/tests/src/Kernel/EntityEmbedFilterTest.php @@ -4,6 +4,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheableMetadata; +use Drupal\filter\FilterProcessResult; /** * @coversDefaultClass \Drupal\entity_embed\Plugin\Filter\EntityEmbedFilter @@ -48,13 +49,25 @@ public function testBasics(array $embed_attributes, $expected_view_mode, array $ 'node_view', 'user:2', 'user_view', - ], $result->getCacheTags()); - $this->assertSame(['timezone', 'user.permissions'], $result->getCacheContexts()); + ], $this->getCacheTags($result)); + $this->assertSame(['timezone', 'user.permissions'], $this->getCacheContexts($result)); $this->assertSame(Cache::PERMANENT, $result->getCacheMaxAge()); $this->assertSame(['library'], array_keys($result->getAttachments())); $this->assertSame(['entity_embed/caption'], $result->getAttachments()['library']); } + private function getCacheTags(FilterProcessResult $result): array { + $cache_tags = $result->getCacheTags(); + sort($cache_tags); + return $cache_tags; + } + + private function getCacheContexts(FilterProcessResult $result): array { + $cache_contexts = $result->getCacheContexts(); + sort($cache_contexts); + return $cache_contexts; + } + /** * Data provider for testBasics(). */ @@ -73,7 +86,7 @@ public function providerTestBasics() { 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-langcode' => 'en', 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'teaser', + 'data-entity-embed-display-settings' => '{"view_mode":"teaser"}', ], ], 'data-entity-uuid + data-view-mode=full' => [ @@ -82,14 +95,14 @@ public function providerTestBasics() { 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-view-mode' => 'full', ], - 'default', + 'full', [ 'data-entity-type' => 'node', 'data-view-mode' => 'full', 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-langcode' => 'en', 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'full', + 'data-entity-embed-display-settings' => '{"view_mode":"full"}', ], ], 'data-entity-uuid + data-view-mode=default' => [ @@ -105,7 +118,7 @@ public function providerTestBasics() { 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-langcode' => 'en', 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'default', + 'data-entity-embed-display-settings' => '{"view_mode":"default"}', ], ], 'data-entity-uuid + data-entity-embed-display' => [ @@ -115,10 +128,10 @@ public function providerTestBasics() { 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', 'data-entity-embed-display-settings' => '{"view_mode":"full"}', ], - 'default', + 'full', [ 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'full', + 'data-entity-embed-display-settings' => '{"view_mode":"full"}', 'data-entity-type' => 'node', 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-langcode' => 'en', @@ -132,10 +145,10 @@ public function providerTestBasics() { 'data-entity-embed-display-settings' => '{"view_mode":"full"}', 'data-view-mode' => 'some-invalid-view-mode', ], - 'default', + 'full', [ 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'full', + 'data-entity-embed-display-settings' => '{"view_mode":"full"}', 'data-entity-type' => 'node', 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-view-mode' => 'some-invalid-view-mode', @@ -159,7 +172,7 @@ public function providerTestBasics() { 'data-view-mode' => 'teaser', 'data-langcode' => 'en', 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'teaser', + 'data-entity-embed-display-settings' => '{"view_mode":"teaser"}', ], ], ]; @@ -195,8 +208,8 @@ public function testAccessUnpublished($allowed_to_view_unpublished, $expected_re } // Expected bubbleable metadata. - $this->assertSame($expected_cacheability->getCacheTags(), $result->getCacheTags()); - $this->assertSame($expected_cacheability->getCacheContexts(), $result->getCacheContexts()); + $this->assertSame($expected_cacheability->getCacheTags(), $this->getCacheTags($result)); + $this->assertSame($expected_cacheability->getCacheContexts(), $this->getCacheContexts($result)); $this->assertSame($expected_cacheability->getCacheMaxAge(), $result->getCacheMaxAge()); $this->assertSame($expected_attachments, $result->getAttachments()); } @@ -257,9 +270,10 @@ public function testMissingEntityIndicator($entity_type_id, $uuid, $expected_mis $this->applyFilter($content); $this->assertCount(0, $this->cssSelect('div.embedded-entity > [data-entity-embed-test-view-mode="default"]')); $this->assertCount(0, $this->cssSelect('div.embedded-entity')); - $deleted_embed_warning = $this->cssSelect('img')[0]; + /** @var \SimpleXMLElement[] $deleted_embed_warning */ + $deleted_embed_warning = $this->cssSelect('img'); $this->assertNotEmpty($deleted_embed_warning); - $this->assertHasAttributes($deleted_embed_warning, [ + $this->assertHasAttributes($deleted_embed_warning[0], [ 'alt' => $expected_missing_text, 'src' => file_url_transform_relative(file_create_url('core/modules/media/images/icons/no-thumbnail.png')), 'title' => $expected_missing_text, @@ -351,7 +365,7 @@ public function testFilterIntegration(array $filter_ids, array $additional_attri 'data-entity-uuid' => static::EMBEDDED_ENTITY_UUID, 'data-langcode' => 'en', 'data-entity-embed-display' => 'entity_reference:entity_reference_entity_view', - 'data-entity-embed-display-settings' => 'teaser', + 'data-entity-embed-display-settings' => '{"view_mode":"teaser"}', ]); $this->assertSame([ 'config:filter.format.plain_text', @@ -360,8 +374,8 @@ public function testFilterIntegration(array $filter_ids, array $additional_attri 'node_view', 'user:2', 'user_view', - ], $result->getCacheTags()); - $this->assertSame(['timezone', 'user.permissions'], $result->getCacheContexts()); + ], $this->getCacheTags($result)); + $this->assertSame(['timezone', 'user.permissions'], $this->getCacheContexts($result)); $this->assertSame(Cache::PERMANENT, $result->getCacheMaxAge()); $this->assertSame(['library'], array_keys($result->getAttachments())); $this->assertSame($expected_asset_libraries, $result->getAttachments()['library']);